Changeset 436 for WizardsToolkit/trunk
- Timestamp:
- 10/23/09 12:00:26 (4 weeks ago)
- Location:
- WizardsToolkit/trunk/wizard
- Files:
-
- 3 modified
-
semaphore.c (modified) (5 diffs)
-
semaphore.h (modified) (1 diff)
-
wizard.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
WizardsToolkit/trunk/wizard/semaphore.c
r411 r436 82 82 semaphore_mutex = 0; 83 83 #endif 84 85 static WizardBooleanType86 instantiate_semaphore = WizardFalse;87 84 88 85 /* … … 199 196 % % 200 197 % % 201 % D e s t r o y S e m a p h o r e %202 % % 203 % % 204 % % 205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 206 % 207 % DestroySemaphore () destroys the semaphore environment.208 % 209 % The format of the DestroySemaphore method is:210 % 211 % DestroySemaphore (void)212 % 213 */ 214 WizardExport void DestroySemaphore (void)198 % D e s t r o y S e m a p h o r e C o m p o n e n t % 199 % % 200 % % 201 % % 202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 203 % 204 % DestroySemaphoreComponent() destroys the semaphore environment. 205 % 206 % The format of the DestroySemaphoreComponent method is: 207 % 208 % DestroySemaphoreComponent(void) 209 % 210 */ 211 WizardExport void DestroySemaphoreComponent(void) 215 212 { 216 213 #if defined(WIZARDSTOOLKIT_HAVE_PTHREAD) … … 218 215 (void) fprintf(stderr,"pthread_mutex_destroy failed %s\n", 219 216 GetExceptionMessage(errno)); 220 #elif defined(WIZARDSTOOLKIT_HAVE_WINTHREADS) 221 if (instantiate_semaphore == WizardFalse) 222 DeleteCriticalSection(&semaphore_mutex); 223 #endif 224 instantiate_semaphore=WizardFalse; 217 #endif 225 218 } 226 219 … … 268 261 % % 269 262 % % 270 % I n s t a n t i a t e S e m a p h o r e %271 % % 272 % % 273 % % 274 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 275 % 276 % InstantiateSemaphore () instantiates the semaphore environment.277 % 278 % The format of the InstantiateSemaphore method is:263 % I n s t a n t i a t e S e m a p h o r e C o m p o n e n t % 264 % % 265 % % 266 % % 267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 268 % 269 % InstantiateSemaphoreComponent() instantiates the semaphore component. 270 % 271 % The format of the InstantiateSemaphoreComponent method is: 279 272 % 280 273 % WizardBooleanType InstantiateSemaphore(void) 281 274 % 282 275 */ 283 WizardExport WizardBooleanType InstantiateSemaphore (void)276 WizardExport WizardBooleanType InstantiateSemaphoreComponent(void) 284 277 { 285 278 LockWizardMutex(); … … 314 307 GetExceptionMessage(errno)); 315 308 #elif defined(WIZARDSTOOLKIT_HAVE_WINTHREADS) 316 if (instantiate_semaphore == WizardFalse)317 InitializeCriticalSection(&semaphore_mutex);318 instantiate_semaphore=WizardTrue;319 309 while (InterlockedCompareExchange(&semaphore_mutex,1L,0L) != 0) 320 310 Sleep(10); -
WizardsToolkit/trunk/wizard/semaphore.h
r411 r436 31 31 extern WizardExport void 32 32 AcquireSemaphoreInfo(SemaphoreInfo **), 33 DestroySemaphore (void),33 DestroySemaphoreComponent(void), 34 34 DestroySemaphoreInfo(SemaphoreInfo **), 35 35 RelinquishSemaphoreInfo(SemaphoreInfo *); 36 36 37 37 extern WizardExport WizardBooleanType 38 InstantiateSemaphore (void),38 InstantiateSemaphoreComponent(void), 39 39 LockSemaphoreInfo(SemaphoreInfo *), 40 40 UnlockSemaphoreInfo(SemaphoreInfo *); -
WizardsToolkit/trunk/wizard/wizard.c
r415 r436 315 315 % WizardsToolkitTerminus(void) 316 316 % 317 %318 317 */ 319 318 WizardExport void WizardsToolkitTerminus(void) … … 323 322 DestroyRandomComponent(); 324 323 DestroyLogComponent(); 325 } 324 DestroySemaphoreComponent(); 325 }
