Fix semaphore emulation on Windows
authorAron Rosenberg <arosenberg@logitech.com>
Fri, 6 May 2011 04:10:37 +0000 (00:10 -0400)
committerJohn Koleszar <jkoleszar@google.com>
Fri, 6 May 2011 04:13:59 +0000 (00:13 -0400)
commiteeb811730362868458410ed96673ee75c2d79220
treea70f756a7e37a0fab306561da4f910c245985593
parenteb16f00cf25e54f08c5a9ec25a8780ca708a2c3a
Fix semaphore emulation on Windows

The existing emulation of posix semaphores on Windows uses SetEvent()
and WaitForSingleObject(), which implements a binary semaphore, not a
counting semaphore as implemented by posix. This causes deadlock when
used with the expected posix semantics. Instead, this patch uses the
CreateSemaphore() and ReleaseSemaphore() calls (introduced in Windows
2000) which have the expected behavior.

This patch also reverts commit eb16f00, which split a semaphore that
was being used with counting semantics into two binary semaphores.
That commit is unnecessary with corrected emulation.

Change-Id: If400771536a27af4b0c3a31aa4c4e9ced89ce6a0
vp8/common/threading.h
vp8/encoder/ethreading.c
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h