Skip to content

Commit 475dc68

Browse files
authored
Merge pull request #11271 from gadmm/systhread_simpl_and_fixes
Simplifications and fixes to multicore systhreads implementation
2 parents 6f9a0a0 + cd4aa47 commit 475dc68

5 files changed

Lines changed: 118 additions & 147 deletions

File tree

otherlibs/systhreads/st_pthreads.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,6 @@ static void st_thread_join(st_thread_id thr)
7171
/* best effort: ignore errors */
7272
}
7373

74-
/* Thread-specific state */
75-
76-
typedef pthread_key_t st_tlskey;
77-
78-
static int st_tls_newkey(st_tlskey * res)
79-
{
80-
return pthread_key_create(res, NULL);
81-
}
82-
83-
Caml_inline void * st_tls_get(st_tlskey k)
84-
{
85-
return pthread_getspecific(k);
86-
}
87-
88-
Caml_inline void st_tls_set(st_tlskey k, void * v)
89-
{
90-
pthread_setspecific(k, v);
91-
}
92-
9374
/* The master lock. This is a mutex that is held most of the time,
9475
so we implement it in a slightly convoluted way to avoid
9576
all risks of busy-waiting. Also, we count the number of waiting

0 commit comments

Comments
 (0)