12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #include <stdio.h>
- #include <stdlib.h>
- #include "pthread.h"
- #include "implement.h"
- int pthread_init(void)
- {
- if (pte_processInitialized)
- {
-
- return PTE_TRUE;
- }
- 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 (pte_processInitialized);
- }
|