Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
7cb50e3a
Commit
7cb50e3a
authored
Aug 29, 2006
by
Simon Marlow
Browse files
fix some rerrors in the worker counting
parent
213fbc81
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/win32/IOManager.c
View file @
7cb50e3a
...
...
@@ -220,10 +220,16 @@ IOWorkerProc(PVOID param)
free
(
work
);
}
else
{
fprintf
(
stderr
,
"unable to fetch work; fatal.
\n
"
);
fflush
(
stderr
);
EnterCriticalSection
(
&
iom
->
manLock
);
ioMan
->
numWorkers
--
;
LeaveCriticalSection
(
&
iom
->
manLock
);
return
1
;
}
}
else
{
fprintf
(
stderr
,
"waiting failed (%lu); fatal.
\n
"
,
rc
);
fflush
(
stderr
);
EnterCriticalSection
(
&
iom
->
manLock
);
ioMan
->
numWorkers
--
;
LeaveCriticalSection
(
&
iom
->
manLock
);
return
1
;
}
}
...
...
@@ -334,14 +340,12 @@ depositWorkItem( unsigned int reqID,
if
(
(
ioMan
->
workersIdle
<
ioMan
->
queueSize
)
)
{
/* No, go ahead and create another. */
ioMan
->
numWorkers
++
;
LeaveCriticalSection
(
&
ioMan
->
manLock
);
NewIOWorkerThread
(
ioMan
);
}
else
{
LeaveCriticalSection
(
&
ioMan
->
manLock
);
if
(
NewIOWorkerThread
(
ioMan
))
{
ioMan
->
numWorkers
--
;
}
}
}
else
{
LeaveCriticalSection
(
&
ioMan
->
manLock
);
}
LeaveCriticalSection
(
&
ioMan
->
manLock
);
if
(
SubmitWork
(
ioMan
->
workQueue
,
wItem
))
{
/* Note: the work item has potentially been consumed by a worker thread
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment