runtime: correct semaphore implementation on netbsd

NetBSD's semaphores use the underlying lighweight process mechanism
(LWP) on NetBSD, rather than pthreads. This means the m.prodcid needs
to be set to the LWP ID rather than the pthread ID in order for unpark
notifications to get sent to the right place.

Introduce a new getProcID() method that selects the correct ID for the

Change-Id: I897406e5a9d5bb9025088680ee9f89b9a6c8ff11
Run-TryBot: Martin Möhrmann <>
Trust: Than McIntosh <>
Trust: Benny Siegert <>
Reviewed-by: Benny Siegert <>
6 files changed