projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
correction to last commit: Korean and Romanian translations will only be in 2.9.1...
[wxWidgets.git]
/
src
/
os2
/
thread.cpp
diff --git
a/src/os2/thread.cpp
b/src/os2/thread.cpp
index bcdd9e1934bdddd3064ddf3b10972e435182f802..f0b8e6068e537e7b8aee83eaf93c1a0fd604dc0c 100644
(file)
--- a/
src/os2/thread.cpp
+++ b/
src/os2/thread.cpp
@@
-96,7
+96,8
@@
public:
bool IsOk() const { return m_vMutex != NULL; }
wxMutexError Lock() { return LockTimeout(SEM_INDEFINITE_WAIT); }
bool IsOk() const { return m_vMutex != NULL; }
wxMutexError Lock() { return LockTimeout(SEM_INDEFINITE_WAIT); }
- wxMutexError TryLock() { return LockTimeout(SEM_IMMEDIATE_RETURN); }
+ wxMutexError Lock(unsigned long ms) { return LockTimeout(ms); }
+ wxMutexError TryLock();
wxMutexError Unlock();
private:
wxMutexError Unlock();
private:
@@
-127,6
+128,14
@@
wxMutexInternal::~wxMutexInternal()
}
}
}
}
+wxMutexError wxMutexInternal::TryLock()
+{
+ const wxMutexError rc = LockTimeout( SEM_IMMEDIATE_RETURN );
+
+ // we have a special return code for timeout in this case
+ return rc == wxMUTEX_TIMEOUT ? wxMUTEX_BUSY : rc;
+}
+
wxMutexError wxMutexInternal::LockTimeout(ULONG ulMilliseconds)
{
APIRET ulrc;
wxMutexError wxMutexInternal::LockTimeout(ULONG ulMilliseconds)
{
APIRET ulrc;
@@
-136,6
+145,7
@@
wxMutexError wxMutexInternal::LockTimeout(ULONG ulMilliseconds)
switch (ulrc)
{
case ERROR_TIMEOUT:
switch (ulrc)
{
case ERROR_TIMEOUT:
+ return wxMUTEX_TIMEOUT;
case ERROR_TOO_MANY_SEM_REQUESTS:
return wxMUTEX_BUSY;
case ERROR_TOO_MANY_SEM_REQUESTS:
return wxMUTEX_BUSY;
@@
-559,13
+569,6
@@
void wxThread::Yield()
::DosSleep(0);
}
::DosSleep(0);
}
-void wxThread::Sleep(
- unsigned long ulMilliseconds
-)
-{
- ::DosSleep(ulMilliseconds);
-}
-
int wxThread::GetCPUCount()
{
ULONG CPUCount;
int wxThread::GetCPUCount()
{
ULONG CPUCount;
@@
-975,7
+978,7
@@
void WXDLLEXPORT wxWakeUpMainThread()
#endif
}
#endif
}
-void
WXDLLEXPORT wxMutexGuiEnter
()
+void
wxMutexGuiEnterImpl
()
{
// this would dead lock everything...
wxASSERT_MSG( !wxThread::IsMain(),
{
// this would dead lock everything...
wxASSERT_MSG( !wxThread::IsMain(),
@@
-997,7
+1000,7
@@
void WXDLLEXPORT wxMutexGuiEnter()
gs_pCritsectGui->Enter();
}
gs_pCritsectGui->Enter();
}
-void
WXDLLEXPORT wxMutexGuiLeave
()
+void
wxMutexGuiLeaveImpl
()
{
wxCriticalSectionLocker enter(*gs_pCritsectWaitingForGui);
{
wxCriticalSectionLocker enter(*gs_pCritsectWaitingForGui);