mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-10 10:13:35 +00:00
Add base::this_thread::native_handle() function
This commit is contained in:
parent
e1828ca6f3
commit
73843ea564
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2001-2015 David Capello
|
||||
Copyright (c) 2001-2016 David Capello
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Aseprite Base Library
|
||||
*Copyright (C) 2001-2015 David Capello*
|
||||
*Copyright (C) 2001-2016 David Capello*
|
||||
|
||||
> Distributed under [MIT license](LICENSE.txt)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Base Library
|
||||
// Copyright (c) 2001-2013, 2015 David Capello
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -152,3 +152,16 @@ void base::this_thread::sleep_for(double seconds)
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
base::thread::native_handle_type base::this_thread::native_handle()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
||||
return GetCurrentThread();
|
||||
|
||||
#else
|
||||
|
||||
return (void*)pthread_self();
|
||||
|
||||
#endif
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Base Library
|
||||
// Copyright (c) 2001-2013 David Capello
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -92,6 +92,7 @@ namespace base { // Based on C++0x threads lib
|
||||
{
|
||||
void yield();
|
||||
void sleep_for(double seconds);
|
||||
thread::native_handle_type native_handle();
|
||||
}
|
||||
|
||||
// This class joins the thread in its destructor.
|
||||
|
Loading…
x
Reference in New Issue
Block a user