forked from ninja-build/ninja
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TokenPool to SubprocessSet::DoWork()
- add monitor interface to TokenPool - posix: monitor token rfd_ in DoWork() too
- Loading branch information
Stefan Becker
committed
May 27, 2016
1 parent
e1ee0f4
commit 9832d65
Showing
6 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ struct GNUmakeTokenPool : public TokenPool { | |
virtual void Reserve(); | ||
virtual void Release(); | ||
virtual void Clear(); | ||
virtual int GetMonitorFd(); | ||
|
||
bool Setup(); | ||
|
||
|
@@ -201,6 +202,10 @@ void GNUmakeTokenPool::Clear() { | |
Return(); | ||
} | ||
|
||
int GNUmakeTokenPool::GetMonitorFd() { | ||
return(rfd_); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stefanb2
Owner
|
||
} | ||
|
||
struct TokenPool *TokenPool::Get(void) { | ||
GNUmakeTokenPool *tokenpool = new GNUmakeTokenPool; | ||
if (tokenpool->Setup()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This won't work, if there are more tokens than jobs to run then rfd_ will always be readable, the poll in DoWork will return immediately, and ninja will spin.