aboutsummaryrefslogtreecommitdiff
path: root/libphobos
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-10-23 16:48:25 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-10-27 11:50:35 +0100
commitd249ba878cc0c300cb8c39988a57fa4ca93f9088 (patch)
treeafb898249ecbc7fd11a420ae4e5816926ae1e076 /libphobos
parente419ede8915eeb879de3d9c026cd4213aaceb86a (diff)
downloadgcc-d249ba878cc0c300cb8c39988a57fa4ca93f9088.zip
gcc-d249ba878cc0c300cb8c39988a57fa4ca93f9088.tar.gz
gcc-d249ba878cc0c300cb8c39988a57fa4ca93f9088.tar.bz2
d: Remove the d_critsec_size target hook.
The allocation of mutex objects for synchronized statements has been moved to the library as of merging druntime 58560d51. All support code in the compiler for getting the OS critical section size has been removed along with it. Reviewed-on: https://github.com/dlang/dmd/pull/11902 https://github.com/dlang/druntime/pull/3248 gcc/ChangeLog: * config/aarch64/aarch64-linux.h (GNU_USER_TARGET_D_CRITSEC_SIZE): Remove. * config/glibc-d.c (glibc_d_critsec_size): Likewise. (TARGET_D_CRITSEC_SIZE): Likewise. * config/i386/linux-common.h (GNU_USER_TARGET_D_CRITSEC_SIZE): Likewise. * config/sol2-d.c (solaris_d_critsec_size): Likewise. (TARGET_D_CRITSEC_SIZE): Likewise. * doc/tm.texi.in (TARGET_D_CRITSEC_SIZE): Likewise. * doc/tm.texi: Regenerate. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd bec5973b0. * d-target.cc (Target::critsecsize): Remove. * d-target.def: Remove d_critsec_size. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 58560d51.
Diffstat (limited to 'libphobos')
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/rt/critical_.d18
2 files changed, 19 insertions, 1 deletions
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index bcde105..485f8e9 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-d05ebaad15fbffce6d707c138c84d7b60fcf5ffd
+58560d5163381b0f1c893bd0d035b7a0a1631f92
The first line of this file holds the git revision number of the last
merge done from the dlang/druntime repository.
diff --git a/libphobos/libdruntime/rt/critical_.d b/libphobos/libdruntime/rt/critical_.d
index c2ef822..40030ad 100644
--- a/libphobos/libdruntime/rt/critical_.d
+++ b/libphobos/libdruntime/rt/critical_.d
@@ -31,12 +31,30 @@ extern (C) void _d_critical_term()
extern (C) void _d_criticalenter(D_CRITICAL_SECTION* cs)
{
+ assert(cs !is null);
ensureMutex(cast(shared(D_CRITICAL_SECTION*)) cs);
lockMutex(&cs.mtx);
}
+extern (C) void _d_criticalenter2(D_CRITICAL_SECTION** pcs)
+{
+ if (atomicLoad!(MemoryOrder.acq)(*cast(shared) pcs) is null)
+ {
+ lockMutex(cast(Mutex*)&gcs.mtx);
+ if (atomicLoad!(MemoryOrder.raw)(*cast(shared) pcs) is null)
+ {
+ auto cs = new shared D_CRITICAL_SECTION;
+ initMutex(cast(Mutex*)&cs.mtx);
+ atomicStore!(MemoryOrder.rel)(*cast(shared) pcs, cs);
+ }
+ unlockMutex(cast(Mutex*)&gcs.mtx);
+ }
+ lockMutex(&(*pcs).mtx);
+}
+
extern (C) void _d_criticalexit(D_CRITICAL_SECTION* cs)
{
+ assert(cs !is null);
unlockMutex(&cs.mtx);
}