21 return (
UINTN)pthread_mutex_lock ((pthread_mutex_t *)Mutex);
30 return (
UINTN)pthread_mutex_unlock ((pthread_mutex_t *)Mutex);
39 return (
UINTN)pthread_mutex_trylock ((pthread_mutex_t *)Mutex);
47 pthread_mutex_t *Mutex;
50 Mutex = malloc (
sizeof (pthread_mutex_t));
51 err = pthread_mutex_init (Mutex,
NULL);
65 return pthread_mutex_destroy ((pthread_mutex_t *)Mutex);
73 pthread_mutex_t Mutex;
74 THREAD_THUNK_THREAD_ENTRY Start;
78 PTHREAD_MUTEX_INITIALIZER,
87 THREAD_THUNK_THREAD_ENTRY Start;
91 Start = mThreadMangle.Start;
92 pthread_mutex_unlock (&mThreadMangle.Mutex);
95 sigfillset (&SigMask);
96 pthread_sigmask (SIG_BLOCK, &SigMask,
NULL);
106 return (VOID *)ReverseGasketUint64 ((
UINTN)Start, (
UINTN)Context);
113 IN THREAD_THUNK_THREAD_ENTRY Start,
118 BOOLEAN EnabledOnEntry;
123 if (SecInterruptEanbled ()) {
124 SecDisableInterrupt ();
125 EnabledOnEntry =
TRUE;
127 EnabledOnEntry =
FALSE;
131 pthread_mutex_lock (&mThreadMangle.Mutex);
132 mThreadMangle.Start = Start;
134 err = pthread_create (Thread, Attribute, SecFakePthreadStart, Context);
137 pthread_mutex_unlock (&mThreadMangle.Mutex);
140 if (EnabledOnEntry) {
142 SecEnableInterrupt ();
153 pthread_exit (ValuePtr);
165 return (
UINTN)pthread_self ();
169 GasketPthreadMutexLock,
170 GasketPthreadMutexUnLock,
171 GasketPthreadMutexTryLock,
172 GasketPthreadMutexInit,
173 GasketPthreadMutexDestroy,
184 if (This->Instance != 0) {
186 return EFI_NOT_FOUND;
189 if (This->ConfigString[0] == L
'0') {
191 return EFI_NOT_FOUND;
194 This->Interface = &gPthreadThunk;
208 &gEmuThreadThunkProtocolGuid,