Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1.  
  2. void __mutex_lock(volatile int *val);
  3.  
  4. typedef struct {
  5.   int counter;
  6.   void *sema;
  7. } __gthread_mutex_t;
  8.  
  9. void __gthr_win32_mutex_init_function (__gthread_mutex_t *mutex)
  10. {
  11.   mutex->counter = 0;
  12.   mutex->sema = 0;
  13. }
  14.  
  15. int __gthr_win32_mutex_lock (__gthread_mutex_t *mutex)
  16. {
  17.     __mutex_lock(&mutex->counter);
  18.     return 0;
  19. }
  20.  
  21. int
  22. __gthr_win32_mutex_unlock (__gthread_mutex_t *mutex)
  23. {
  24.   mutex->counter = 0;
  25.   return 0;
  26. }
  27.  
  28.