/[eiffelstudio]/branches/eth/eve/Src/C/run-time/posix_threads.c
ViewVC logotype

Diff of /branches/eth/eve/Src/C/run-time/posix_threads.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 94982 by jasonw, Fri Apr 26 23:06:21 2013 UTC revision 94983 by jasonw, Fri May 2 11:05:28 2014 UTC
# Line 880  rt_public int eif_pthread_sem_create (EI Line 880  rt_public int eif_pthread_sem_create (EI
880          if (*sem == NULL) {          if (*sem == NULL) {
881                  Result = T_CANNOT_CREATE_SEMAPHORE;                  Result = T_CANNOT_CREATE_SEMAPHORE;
882          } else {          } else {
883  #if EIF_OS == EIF_OS_DARWIN  #if (EIF_OS == EIF_OS_DARWIN) || (EIF_OS == EIF_OS_IPHONE)
884                  if (shared) {                  if (shared) {
885                                  /* We do not support shared mutexes on Mac OS X. */                                  /* We do not support shared mutexes on Mac OS X. */
886                          Result = T_UNSUPPORTED;                          Result = T_UNSUPPORTED;
# Line 962  rt_public int eif_pthread_sem_destroy (E Line 962  rt_public int eif_pthread_sem_destroy (E
962          int Result;          int Result;
963          if (sem) {          if (sem) {
964  #ifdef EIF_POSIX_THREADS  #ifdef EIF_POSIX_THREADS
965  #if EIF_OS == EIF_OS_DARWIN  #if (EIF_OS == EIF_OS_DARWIN) || (EIF_OS == EIF_OS_IPHONE)
966                  if (eif_pthread_mutex_destroy(sem->mutex) == T_OK) {                  if (eif_pthread_mutex_destroy(sem->mutex) == T_OK) {
967                          if (eif_pthread_cond_destroy(sem->cond) == T_OK) {                          if (eif_pthread_cond_destroy(sem->cond) == T_OK) {
968                                  Result = T_OK;                                  Result = T_OK;
# Line 1016  rt_public int eif_pthread_sem_post (EIF_ Line 1016  rt_public int eif_pthread_sem_post (EIF_
1016  {  {
1017          int Result;          int Result;
1018  #ifdef EIF_POSIX_THREADS  #ifdef EIF_POSIX_THREADS
1019  #if EIF_OS == EIF_OS_DARWIN  #if (EIF_OS == EIF_OS_DARWIN) || (EIF_OS == EIF_OS_IPHONE)
1020          Result = eif_pthread_mutex_lock(sem->mutex);          Result = eif_pthread_mutex_lock(sem->mutex);
1021          if (Result == T_OK) {          if (Result == T_OK) {
1022                  sem->val += 1;                  sem->val += 1;
# Line 1072  rt_public int eif_pthread_sem_wait (EIF_ Line 1072  rt_public int eif_pthread_sem_wait (EIF_
1072  {  {
1073          int Result;          int Result;
1074  #ifdef EIF_POSIX_THREADS  #ifdef EIF_POSIX_THREADS
1075  #if EIF_OS == EIF_OS_DARWIN  #if (EIF_OS == EIF_OS_DARWIN) || (EIF_OS == EIF_OS_IPHONE)
1076          Result = eif_pthread_mutex_lock(sem->mutex);          Result = eif_pthread_mutex_lock(sem->mutex);
1077          if (Result == T_OK) {          if (Result == T_OK) {
1078                  while ((sem->val == 0) && (Result == T_OK)) {                  while ((sem->val == 0) && (Result == T_OK)) {
# Line 1135  rt_private rt_inline int eif_pthread_sem Line 1135  rt_private rt_inline int eif_pthread_sem
1135  #if defined(__SunOS_5_8) || defined (__SunOS_5_9) || (EIF_OS == EIF_OS_OPENBSD)  #if defined(__SunOS_5_8) || defined (__SunOS_5_9) || (EIF_OS == EIF_OS_OPENBSD)
1136          Result = T_NOT_IMPLEMENTED;          Result = T_NOT_IMPLEMENTED;
1137  #else  #else
1138  #if EIF_OS == EIF_OS_DARWIN  #if (EIF_OS == EIF_OS_DARWIN) || (EIF_OS == EIF_OS_IPHONE)
1139          int other_result;          int other_result;
1140          Result = eif_pthread_mutex_lock(sem->mutex);          Result = eif_pthread_mutex_lock(sem->mutex);
1141          if (Result == T_OK) {          if (Result == T_OK) {
# Line 1208  rt_public int eif_pthread_sem_trywait (E Line 1208  rt_public int eif_pthread_sem_trywait (E
1208  {  {
1209          int Result;          int Result;
1210  #ifdef EIF_POSIX_THREADS  #ifdef EIF_POSIX_THREADS
1211  #if EIF_OS == EIF_OS_DARWIN  #if (EIF_OS == EIF_OS_DARWIN) || (EIF_OS == EIF_OS_IPHONE)
1212          Result = eif_pthread_sem_wait_with_timeout(sem, 0);          Result = eif_pthread_sem_wait_with_timeout(sem, 0);
1213          if (Result == T_TIMEDOUT) {          if (Result == T_TIMEDOUT) {
1214                  Result = T_BUSY;                  Result = T_BUSY;

Legend:
Removed from v.94982  
changed lines
  Added in v.94983

  ViewVC Help
Powered by ViewVC 1.1.23