mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-11 11:44:03 +02:00
gpoll: rename timeout to timeout_ms for clarity
This commit is contained in:
18
glib/gpoll.c
18
glib/gpoll.c
@@ -133,7 +133,7 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
HANDLE *handles,
|
HANDLE *handles,
|
||||||
GPollFD *handle_to_fd[],
|
GPollFD *handle_to_fd[],
|
||||||
gint nhandles,
|
gint nhandles,
|
||||||
gint timeout)
|
gint timeout_ms)
|
||||||
{
|
{
|
||||||
DWORD ready;
|
DWORD ready;
|
||||||
GPollFD *f;
|
GPollFD *f;
|
||||||
@@ -145,9 +145,9 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
* -> Use MsgWaitForMultipleObjectsEx
|
* -> Use MsgWaitForMultipleObjectsEx
|
||||||
*/
|
*/
|
||||||
if (_g_main_poll_debug)
|
if (_g_main_poll_debug)
|
||||||
g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout);
|
g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
|
||||||
|
|
||||||
ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout,
|
ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout_ms,
|
||||||
QS_ALLINPUT, MWMO_ALERTABLE);
|
QS_ALLINPUT, MWMO_ALERTABLE);
|
||||||
|
|
||||||
if (ready == WAIT_FAILED)
|
if (ready == WAIT_FAILED)
|
||||||
@@ -160,12 +160,12 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
else if (nhandles == 0)
|
else if (nhandles == 0)
|
||||||
{
|
{
|
||||||
/* No handles to wait for, just the timeout */
|
/* No handles to wait for, just the timeout */
|
||||||
if (timeout == INFINITE)
|
if (timeout_ms == INFINITE)
|
||||||
ready = WAIT_FAILED;
|
ready = WAIT_FAILED;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Wait for the current process to die, more efficient than SleepEx(). */
|
/* Wait for the current process to die, more efficient than SleepEx(). */
|
||||||
WaitForSingleObjectEx (GetCurrentProcess (), timeout, TRUE);
|
WaitForSingleObjectEx (GetCurrentProcess (), timeout_ms, TRUE);
|
||||||
ready = WAIT_TIMEOUT;
|
ready = WAIT_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,9 +175,9 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
* -> Use WaitForMultipleObjectsEx
|
* -> Use WaitForMultipleObjectsEx
|
||||||
*/
|
*/
|
||||||
if (_g_main_poll_debug)
|
if (_g_main_poll_debug)
|
||||||
g_print (" WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout);
|
g_print (" WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
|
||||||
|
|
||||||
ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout, TRUE);
|
ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout_ms, TRUE);
|
||||||
if (ready == WAIT_FAILED)
|
if (ready == WAIT_FAILED)
|
||||||
{
|
{
|
||||||
gchar *emsg = g_win32_error_message (GetLastError ());
|
gchar *emsg = g_win32_error_message (GetLastError ());
|
||||||
@@ -205,7 +205,7 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
/* If we have a timeout, or no handles to poll, be satisfied
|
/* If we have a timeout, or no handles to poll, be satisfied
|
||||||
* with just noticing we have messages waiting.
|
* with just noticing we have messages waiting.
|
||||||
*/
|
*/
|
||||||
if (timeout != 0 || nhandles == 0)
|
if (timeout_ms != 0 || nhandles == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* If no timeout and handles to poll, recurse to poll them,
|
/* If no timeout and handles to poll, recurse to poll them,
|
||||||
@@ -224,7 +224,7 @@ poll_rest (GPollFD *msg_fd,
|
|||||||
/* If no timeout and polling several handles, recurse to poll
|
/* If no timeout and polling several handles, recurse to poll
|
||||||
* the rest of them.
|
* the rest of them.
|
||||||
*/
|
*/
|
||||||
if (timeout == 0 && nhandles > 1)
|
if (timeout_ms == 0 && nhandles > 1)
|
||||||
{
|
{
|
||||||
/* Poll the handles with index > ready */
|
/* Poll the handles with index > ready */
|
||||||
HANDLE *shorter_handles;
|
HANDLE *shorter_handles;
|
||||||
|
Reference in New Issue
Block a user