Panda3D
 All Classes Functions Variables Enumerations
threadDummyImpl.cxx
00001 // Filename: threadDummyImpl.cxx
00002 // Created by:  drose (09Aug02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "selectThreadImpl.h"
00016 
00017 #ifdef THREAD_DUMMY_IMPL
00018 
00019 #include "threadDummyImpl.h"
00020 #include "thread.h"
00021 
00022 #ifdef WIN32
00023 #define WIN32_LEAN_AND_MEAN 1
00024 #include <windows.h>
00025 #endif
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //     Function: ThreadDummyImpl::get_unique_id
00029 //       Access: Public
00030 //  Description: 
00031 ////////////////////////////////////////////////////////////////////
00032 string ThreadDummyImpl::
00033 get_unique_id() const {
00034   // In a single-threaded application, this is just the unique process
00035   // ID.
00036   ostringstream strm;
00037 #ifdef WIN32
00038   strm << GetCurrentProcessId();
00039 #else
00040   strm << getpid();
00041 #endif
00042   return strm.str();
00043 }
00044 
00045 ////////////////////////////////////////////////////////////////////
00046 //     Function: ThreadDummyImpl::get_current_thread
00047 //       Access: Public
00048 //  Description: 
00049 ////////////////////////////////////////////////////////////////////
00050 Thread *ThreadDummyImpl::
00051 get_current_thread() {
00052   return Thread::get_main_thread();
00053 }
00054 
00055 #endif  // THREAD_DUMMY_IMPL
 All Classes Functions Variables Enumerations