[ros-diffs] [cgutman] 41633: - Use the timeout that the caller gives us if it is nonzero so we don't block forever if nobody wakes us
cgutman at svn.reactos.org
cgutman at svn.reactos.org
Sun Jun 28 10:32:05 CEST 2009
Author: cgutman
Date: Sat Jun 27 11:03:45 2009
New Revision: 41633
URL: http://svn.reactos.org/svn/reactos?rev=41633&view=rev
Log:
- Use the timeout that the caller gives us if it is nonzero so we don't block forever if nobody wakes us
Modified:
trunk/reactos/lib/drivers/ip/transport/tcp/event.c
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/event.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/tcp/event.c?rev=41633&r1=41632&r2=41633&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Sat Jun 27 11:03:45 2009
@@ -112,6 +112,7 @@
int TCPSleep( void *ClientData, void *token, int priority, char *msg,
int tmio ) {
PSLEEPING_THREAD SleepingThread;
+ LARGE_INTEGER Timeout;
TI_DbgPrint(DEBUG_TCP,
("Called TSLEEP: tok = %x, pri = %d, wmesg = %s, tmio = %x\n",
@@ -131,12 +132,14 @@
InsertTailList( &SleepingThreadsList, &SleepingThread->Entry );
TcpipReleaseFastMutex( &SleepingThreadsLock );
+ Timeout.QuadPart = Int32x32To64(tmio, -10000);
+
TI_DbgPrint(DEBUG_TCP,("Waiting on %x\n", token));
KeWaitForSingleObject( &SleepingThread->Event,
- WrSuspended,
+ Executive,
KernelMode,
TRUE,
- NULL );
+ (tmio != 0) ? &Timeout : NULL );
TcpipAcquireFastMutex( &SleepingThreadsLock );
RemoveEntryList( &SleepingThread->Entry );
More information about the Ros-diffs
mailing list