summaryrefslogtreecommitdiff
path: root/libphobos/libdruntime/core/thread/osthread.d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-02-13 20:17:53 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2022-02-16 11:15:02 +0100
commitd75691877c4a7521a995d2601021fcaf30f65d94 (patch)
tree36509d835d63b98ad1130ac9d4695b5033c10428 /libphobos/libdruntime/core/thread/osthread.d
parent023327643969d5469902a9ecfa6738a315f9e362 (diff)
d: Merge upstream dmd 52844d4b1, druntime dbd0c874, phobos 896b1d0e1.
D front-end changes: - Parsing and compiling C code is now possible using `import'. - `throw' statements can now be used as an expression. - Improvements to the D template emission strategy when compiling with `-funittest'. D Runtime changes: - New core.int128 module for implementing intrinsics to support 128-bit integer types. - C bindings for the kernel and C runtime have been better separated to allow compiling for hybrid targets, such as kFreeBSD. Phobos changes: - The std.experimental.checkedint module has been renamed to std.checkedint. gcc/d/ChangeLog: * d-builtins.cc (d_build_builtins_module): Set purity of DECL_PURE_P functions to PURE::const_. * d-gimplify.cc (bit_field_ref): New function. (d_gimplify_modify_expr): Handle implicit casting for assignments to bit-fields. (d_gimplify_unary_expr): New function. (d_gimplify_binary_expr): New function. (d_gimplify_expr): Handle UNARY_CLASS_P and BINARY_CLASS_P. * d-target.cc (Target::_init): Initialize bitFieldStyle. (TargetCPP::parameterType): Update signature. (Target::supportsLinkerDirective): New function. * dmd/MERGE: Merge upstream dmd 52844d4b1. * expr.cc (ExprVisitor::visit (ThrowExp *)): New function. * types.cc (d_build_bitfield_integer_type): New function. (insert_aggregate_bitfield): New function. (layout_aggregate_members): Handle inserting bit-fields into an aggregate type. libphobos/ChangeLog: * Makefile.in: Regenerate. * libdruntime/MERGE: Merge upstream druntime dbd0c874. * libdruntime/Makefile.am (DRUNTIME_CSOURCES): Add core/int128.d. (DRUNTIME_DISOURCES): Add __builtins.di. * libdruntime/Makefile.in: Regenerate. * src/MERGE: Merge upstream phobos 896b1d0e1. * src/Makefile.am (PHOBOS_DSOURCES): Add std/checkedint.d. * src/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add -fall-instantiations to --gdcflags.
Diffstat (limited to 'libphobos/libdruntime/core/thread/osthread.d')
-rw-r--r--libphobos/libdruntime/core/thread/osthread.d61
1 files changed, 0 insertions, 61 deletions
diff --git a/libphobos/libdruntime/core/thread/osthread.d b/libphobos/libdruntime/core/thread/osthread.d
index fe4d24fafce..ca368098b4b 100644
--- a/libphobos/libdruntime/core/thread/osthread.d
+++ b/libphobos/libdruntime/core/thread/osthread.d
@@ -247,15 +247,6 @@ else
class Thread : ThreadBase
{
//
- // Main process thread
- //
- version (FreeBSD)
- {
- // set when suspend failed and should be retried, see Issue 13416
- private shared bool m_suspendagain;
- }
-
- //
// Standard thread data
//
version (Windows)
@@ -2019,7 +2010,6 @@ extern (C) void thread_suspendAll() nothrow
// subtract own thread
assert(cnt >= 1);
--cnt;
- Lagain:
// wait for semaphore notifications
for (; cnt; --cnt)
{
@@ -2030,20 +2020,6 @@ extern (C) void thread_suspendAll() nothrow
errno = 0;
}
}
- version (FreeBSD)
- {
- // avoid deadlocks, see Issue 13416
- t = ThreadBase.sm_tbeg.toThread;
- while (t)
- {
- auto tn = t.next;
- if (t.m_suspendagain && suspend(t))
- ++cnt;
- t = tn.toThread;
- }
- if (cnt)
- goto Lagain;
- }
}
}
}
@@ -2480,7 +2456,6 @@ else version (Posix)
status = sigdelset( &sigres, resumeSignalNumber );
assert( status == 0 );
- version (FreeBSD) obj.m_suspendagain = false;
status = sem_post( &suspendCount );
assert( status == 0 );
@@ -2491,19 +2466,6 @@ else version (Posix)
obj.m_curr.tstack = obj.m_curr.bstack;
}
}
-
- // avoid deadlocks on FreeBSD, see Issue 13416
- version (FreeBSD)
- {
- auto obj = Thread.getThis();
- if (THR_IN_CRITICAL(obj.m_addr))
- {
- obj.m_suspendagain = true;
- if (sem_post(&suspendCount)) assert(0);
- return;
- }
- }
-
callWithStackShell(&op);
}
@@ -2517,29 +2479,6 @@ else version (Posix)
{
}
-
- // HACK libthr internal (thr_private.h) macro, used to
- // avoid deadlocks in signal handler, see Issue 13416
- version (FreeBSD) bool THR_IN_CRITICAL(pthread_t p) nothrow @nogc
- {
- import core.sys.posix.config : c_long;
- import core.sys.posix.sys.types : lwpid_t;
-
- // If the begin of pthread would be changed in libthr (unlikely)
- // we'll run into undefined behavior, compare with thr_private.h.
- static struct pthread
- {
- c_long tid;
- static struct umutex { lwpid_t owner; uint flags; uint[2] ceilings; uint[4] spare; }
- umutex lock;
- uint cycle;
- int locklevel;
- int critical_count;
- // ...
- }
- auto priv = cast(pthread*)p;
- return priv.locklevel > 0 || priv.critical_count > 0;
- }
}
}
else