<font size=2 face="sans-serif">NSOperation.swift currently makes a call
to pthread_main_np() on line 536. This causes a compilation failure on
Linux as there isn't an implementation of pthread_main_np() in Glibc.</font>
<br>
<br><font size=2 face="sans-serif">There's few ways of fixing this. Before
I go ahead and implement one of them, I'd like to get some input on what
we thing is the best approach.</font>
<br>
<br><font size=2 face="sans-serif">The most obvious approach would be to
leverage the shim we've added to CoreFoundation already. We implemented
pthread_main_np() using the following function in CFPlatform.c:</font>
<br><font size=2 face="sans-serif">Boolean _CFIsMainThread(void) {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; return syscall(SYS_gettid)
== getpid();</font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif">This is only available internally to
CF, but could be exposed to Foundation, either as _CFIsMainThread() or
as pthread_main_np().</font>
<br>
<br><font size=2 face="sans-serif">Other options would be to expose the
pthread_main_np() shim that's in Dispatch already (again internally), or
to add it to the Glibc overlay so its available globally.</font>
<br>
<br><font size=2 face="sans-serif">Any thoughts on the best approach?</font>
<br>
<br><font size=2 face="sans-serif">Chris</font>