Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1066 from MartinNowak/gcDecls
Browse files Browse the repository at this point in the history
cleanup old declarations and import core.memory
  • Loading branch information
AndrejMitrovic committed Dec 13, 2014
2 parents 1c6d1a7 + 831463b commit b18a304
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,13 @@ class ThreadError : Error

private
{
import core.sync.mutex;
import core.atomic;

//
// from core.memory
//
extern (C) void gc_enable() nothrow;
extern (C) void gc_disable() nothrow;
extern (C) void* gc_malloc(size_t sz, uint ba = 0, const TypeInfo = null) pure nothrow;

//
// from core.stdc.string
//
extern (C) void* memcpy(void*, const void*, size_t);
import core.atomic, core.memory, core.sync.mutex;

//
// exposed by compiler runtime
//
extern (C) void rt_moduleTlsCtor();
extern (C) void rt_moduleTlsDtor();

alias void delegate() gc_atom;
extern (C) void function(scope gc_atom) gc_atomic;
}


Expand Down Expand Up @@ -1975,7 +1959,7 @@ extern (C) bool thread_isMainThread()
*/
extern (C) Thread thread_attachThis()
{
gc_disable(); scope(exit) gc_enable();
GC.disable(); scope(exit) GC.enable();

if (auto t = Thread.getThis())
return t;
Expand Down Expand Up @@ -2039,7 +2023,7 @@ version( Windows )
/// ditto
extern (C) Thread thread_attachByAddrB( Thread.ThreadAddr addr, void* bstack )
{
gc_disable(); scope(exit) gc_enable();
GC.disable(); scope(exit) GC.enable();

if (auto t = thread_findByAddr(addr))
return t;
Expand Down

0 comments on commit b18a304

Please sign in to comment.