MySemaphoreThread Class Reference

Inheritance diagram for MySemaphoreThread:

wxThread List of all members.

Detailed Description

Definition at line 548 of file console_socket.cpp.

Public Member Functions

Private Attributes


Constructor & Destructor Documentation

MySemaphoreThread::MySemaphoreThread ( int  i,
wxSemaphore *  sem 
) [inline]

Definition at line 551 of file console_socket.cpp.

00552         : wxThread(wxTHREAD_JOINABLE),
00553           m_sem(sem),
00554           m_i(i)
00555     {
00556         Create();
00557     }


Member Function Documentation

virtual ExitCode MySemaphoreThread::Entry (  )  [inline, virtual]

Definition at line 559 of file console_socket.cpp.

References m_i, and m_sem.

00560     {
00561         wxPrintf(_T("%s: Thread #%d (%ld) starting to wait for semaphore...\n"),
00562                  wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId());
00563 
00564         m_sem->Wait();
00565 
00566         wxPrintf(_T("%s: Thread #%d (%ld) acquired the semaphore.\n"),
00567                  wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId());
00568 
00569         Sleep(1000);
00570 
00571         wxPrintf(_T("%s: Thread #%d (%ld) releasing the semaphore.\n"),
00572                  wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId());
00573 
00574         m_sem->Post();
00575 
00576         return 0;
00577     }


Member Data Documentation

int MySemaphoreThread::m_i [private]

Definition at line 581 of file console_socket.cpp.

Referenced by Entry().

wxSemaphore* MySemaphoreThread::m_sem [private]

Definition at line 580 of file console_socket.cpp.

Referenced by Entry().


The documentation for this class was generated from the following file:
Generated on Wed Feb 28 19:49:32 2007 for Tesseract by  doxygen 1.5.1