~ubuntu-branches/ubuntu/karmic/libsdl1.2/karmic

« back to all changes in this revision

Viewing changes to src/thread/win32/SDL_syssem.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2008-01-05 14:10:45 UTC
  • mto: (2.1.3 lenny)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080105141045-mjdg2rp09mamme4a
Tags: upstream-1.2.13
ImportĀ upstreamĀ versionĀ 1.2.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        switch (WaitForSingleObject(sem->id, dwMilliseconds)) {
106
106
#endif
107
107
            case WAIT_OBJECT_0:
108
 
                --sem->count;
 
108
                InterlockedDecrement(&sem->count);
109
109
                retval = 0;
110
110
                break;
111
111
            case WAIT_TIMEOUT:
150
150
         * immediately get destroyed by another thread which
151
151
         * is waiting for this semaphore.
152
152
         */
153
 
        ++sem->count;
 
153
        InterlockedIncrement(&sem->count);
154
154
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
155
155
        if ( ReleaseSemaphoreCE(sem->id, 1, NULL) == FALSE ) {
156
156
#else
157
157
        if ( ReleaseSemaphore(sem->id, 1, NULL) == FALSE ) {
158
158
#endif
159
 
                --sem->count;   /* restore */
 
159
                InterlockedDecrement(&sem->count);      /* restore */
160
160
                SDL_SetError("ReleaseSemaphore() failed");
161
161
                return -1;
162
162
        }