Created
February 15, 2015 18:12
-
-
Save computerquip/34091bb40b4998450b18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/voglcore/vogl_port.h b/src/voglcore/vogl_port.h | |
index 7a718b3..4b53a1b 100644 | |
--- a/src/voglcore/vogl_port.h | |
+++ b/src/voglcore/vogl_port.h | |
@@ -29,6 +29,7 @@ | |
// The guts of those functions live in the platform-specific CPP files. | |
#pragma once | |
+#include "vogl_threading.h" | |
#include "vogl_core.h" | |
// Change the working directory, return 0 on success and -1 on failure. | |
@@ -50,7 +51,7 @@ bool plat_fexist(const char* path); | |
pid_t plat_gettid(); | |
// Get the posix thread id (which may be the same as above--but they're different in source so different here) | |
-uint64_t plat_posix_gettid(); | |
+vogl::vogl_thread_id_t plat_posix_gettid(); | |
// Get the process id for this process. | |
pid_t plat_getpid(); | |
diff --git a/src/voglcore/vogl_port_posix.cpp b/src/voglcore/vogl_port_posix.cpp | |
index 0df14e4..de22b9d 100644 | |
--- a/src/voglcore/vogl_port_posix.cpp | |
+++ b/src/voglcore/vogl_port_posix.cpp | |
@@ -106,9 +106,9 @@ pid_t plat_gettid() | |
return static_cast<pid_t>(syscall(SYS_gettid)); | |
} | |
-uint64_t plat_posix_gettid() | |
+vogl::vogl_thread_id_t plat_posix_gettid() | |
{ | |
- return reinterpret_cast<uintptr_t>(pthread_self()); | |
+ return pthread_self(); | |
} | |
pid_t plat_getpid() | |
diff --git a/src/voglcore/vogl_threading_pthreads.h b/src/voglcore/vogl_threading_pthreads.h | |
index ab85c92..5606094 100644 | |
--- a/src/voglcore/vogl_threading_pthreads.h | |
+++ b/src/voglcore/vogl_threading_pthreads.h | |
@@ -55,7 +55,7 @@ namespace vogl | |
void vogl_threading_init(); | |
- typedef uint64_t vogl_thread_id_t; | |
+ typedef pthread_t vogl_thread_id_t; | |
vogl_thread_id_t vogl_get_current_thread_id(); | |
void vogl_sleep(unsigned int milliseconds); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment