|
|
1.1 ! root 1: /* ! 2: * UAE - The Un*x Amiga Emulator ! 3: * ! 4: * Threading support, using pthreads ! 5: * ! 6: * Copyright 1997 Bernd Schmidt ! 7: */ ! 8: ! 9: #include <pthread.h> ! 10: #include <semaphore.h> ! 11: ! 12: /* Sempahores. We use POSIX semaphores; if you are porting this to a machine ! 13: * with different ones, make them look like POSIX semaphores. */ ! 14: typedef sem_t uae_sem_t; ! 15: #define uae_sem_init sem_init ! 16: #define uae_sem_destroy sem_destroy ! 17: #define uae_sem_post sem_post ! 18: #define uae_sem_wait sem_wait ! 19: #define uae_sem_trywait sem_trywait ! 20: #define uae_sem_getvalue sem_getvalue ! 21: ! 22: #include "commpipe.h" ! 23: ! 24: typedef pthread_t uae_thread_id; ! 25: #define BAD_THREAD -1 ! 26: ! 27: static __inline__ int uae_start_thread (void *(*f) (void *), void *arg, uae_thread_id *foo) ! 28: { ! 29: return pthread_create (foo, 0, f, arg); ! 30: } ! 31: #define UAE_THREAD_EXIT pthread_exit(0)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.