123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #include <stdio.h>
- #include <stdlib.h>
- #include "pthread.h"
- #include "implement.h"
- void pthread_init(void)
- {
- if (pte_processInitialized)
- {
-
- return;
- }
- pte_processInitialized = PTE_TRUE;
-
- pte_osInit();
-
- if ((pthread_key_create (&pte_selfThreadKey, NULL) != 0) ||
- (pthread_key_create (&pte_cleanupKey, NULL) != 0))
- {
- pthread_terminate();
- }
-
- pte_osMutexCreate (&pte_thread_reuse_lock);
- pte_osMutexCreate (&pte_mutex_test_init_lock);
- pte_osMutexCreate (&pte_cond_list_lock);
- pte_osMutexCreate (&pte_cond_test_init_lock);
- pte_osMutexCreate (&pte_rwlock_test_init_lock);
- pte_osMutexCreate (&pte_spinlock_test_init_lock);
- return;
- }
|