equal
deleted
inserted
replaced
82 1, // maximum count |
82 1, // maximum count |
83 NULL); // unnamed semaphore |
83 NULL); // unnamed semaphore |
84 if (debug_sem == NULL) |
84 if (debug_sem == NULL) |
85 { |
85 { |
86 printf("startPLC CreateSemaphore debug_sem error: %d\n", GetLastError()); |
86 printf("startPLC CreateSemaphore debug_sem error: %d\n", GetLastError()); |
87 return; |
87 return 1; |
88 } |
88 } |
89 |
89 |
90 debug_wait_sem = CreateSemaphore( |
90 debug_wait_sem = CreateSemaphore( |
91 NULL, // default security attributes |
91 NULL, // default security attributes |
92 0, // initial count |
92 0, // initial count |
94 NULL); // unnamed semaphore |
94 NULL); // unnamed semaphore |
95 |
95 |
96 if (debug_wait_sem == NULL) |
96 if (debug_wait_sem == NULL) |
97 { |
97 { |
98 printf("startPLC CreateSemaphore debug_wait_sem error: %d\n", GetLastError()); |
98 printf("startPLC CreateSemaphore debug_wait_sem error: %d\n", GetLastError()); |
99 return; |
99 return 1; |
100 } |
100 } |
101 |
101 |
102 python_sem = CreateSemaphore( |
102 python_sem = CreateSemaphore( |
103 NULL, // default security attributes |
103 NULL, // default security attributes |
104 1, // initial count |
104 1, // initial count |
106 NULL); // unnamed semaphore |
106 NULL); // unnamed semaphore |
107 |
107 |
108 if (python_sem == NULL) |
108 if (python_sem == NULL) |
109 { |
109 { |
110 printf("startPLC CreateSemaphore python_sem error: %d\n", GetLastError()); |
110 printf("startPLC CreateSemaphore python_sem error: %d\n", GetLastError()); |
111 return; |
111 return 1; |
112 } |
112 } |
113 python_wait_sem = CreateSemaphore( |
113 python_wait_sem = CreateSemaphore( |
114 NULL, // default security attributes |
114 NULL, // default security attributes |
115 0, // initial count |
115 0, // initial count |
116 1, // maximum count |
116 1, // maximum count |
118 |
118 |
119 |
119 |
120 if (python_wait_sem == NULL) |
120 if (python_wait_sem == NULL) |
121 { |
121 { |
122 printf("startPLC CreateSemaphore python_wait_sem error: %d\n", GetLastError()); |
122 printf("startPLC CreateSemaphore python_wait_sem error: %d\n", GetLastError()); |
123 return; |
123 return 1; |
124 } |
124 } |
125 |
125 |
126 |
126 |
127 /* Create a waitable timer */ |
127 /* Create a waitable timer */ |
128 timeBeginPeriod(1); |
128 timeBeginPeriod(1); |