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 #77 from braddr/fixcircular
Browse files Browse the repository at this point in the history
move getpid from phobos std.process to druntime core.thread
  • Loading branch information
jmdavis committed Oct 3, 2011
2 parents 55ee633 + 81d3a78 commit 0f16b2b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ public import core.time; // for Duration
// this should be true for most architectures
version = StackGrowsDown;

/**
* Returns the process ID of the calling process, which is guaranteed to be
* unique on the system. This call is always successful.
*
* Example:
* ---
* writefln("Current process id: %s", getpid());
* ---
*/
version(Posix)
{
alias core.sys.posix.unistd.getpid getpid;
}
else version (Windows)
{
alias std.c.windows.windows.GetCurrentProcessId getpid;
}


///////////////////////////////////////////////////////////////////////////////
// Thread and Fiber Exceptions
Expand Down

0 comments on commit 0f16b2b

Please sign in to comment.