Changeset 5070
- Timestamp:
- Sep 2, 2006, 10:06:43 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ccl/lisp-kernel/thread_manager.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lisp-kernel/thread_manager.c
r5005 r5070 180 180 181 181 do { 182 status = SEM_WAIT(s); 182 #ifdef USE_MACH_SEMAPHORES 183 mach_timespec_t q = {1,0}; 184 status = SEM_TIMEDWAIT(s,q); 185 #endif 186 #ifdef USE_POSIX_SEMAPHORES 187 struct timespec q; 188 gettimeofday((struct timeval *)&q, NULL); 189 q.tv_sec += 1; 190 status = SEM_TIMEDWAIT(s,&q); 191 #endif 183 192 } while (status != 0); 184 193 } … … 207 216 return status; 208 217 #endif 209 #ifdef DARWIN218 #ifdef USE_MACH_SEMAPHORES 210 219 mach_timespec_t q = {seconds, nanos}; 211 220 int status = SEM_TIMEDWAIT(s, q); … … 342 351 new_semaphore(int count) 343 352 { 344 #if defined(LINUX) || defined(FREEBSD)353 #ifdef USE_POSIX_SEMAPHORES 345 354 sem_t *s = malloc(sizeof(sem_t)); 346 355 sem_init(s, 0, count); 347 356 return s; 348 357 #endif 349 #ifdef DARWIN358 #ifdef USE_MACH_SEMAPHORES 350 359 semaphore_t s = (semaphore_t)0; 351 360 semaphore_create(mach_task_self(),&s, SYNC_POLICY_FIFO, count); … … 384 393 { 385 394 if (*s) { 386 #if defined(LINUX) || defined(FREEBSD)395 #ifdef USE_POSIX_SEMAPHORES 387 396 sem_destroy((sem_t *)*s); 388 397 #endif 389 #ifdef DARWIN398 #ifdef USE_MACH_SEMAPHORES 390 399 semaphore_destroy(mach_task_self(),((semaphore_t)(natural) *s)); 391 400 #endif … … 948 957 to a dead thread by setting tcr->osid to 0. 949 958 */ 950 #ifdef DARWIN951 if (mach_suspend_tcr(tcr)) {952 SET_TCR_FLAG(tcr,TCR_FLAG_BIT_ALT_SUSPEND);953 return true;954 }955 #endif956 959 tcr->osid = 0; 957 960 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
