Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Unified Diff: test/cctest/test-sockets.cc

Issue 23748003: Cleanup Semaphore class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix for Mac OS X. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-semaphore.cc ('k') | test/cctest/test-thread-termination.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-sockets.cc
diff --git a/test/cctest/test-sockets.cc b/test/cctest/test-sockets.cc
index a9e31fc89d04c4b7a036af8eb80a4e6406e32ac8..87a62cee9a9baaeca09fcc06555ecb52748c3b1e 100644
--- a/test/cctest/test-sockets.cc
+++ b/test/cctest/test-sockets.cc
@@ -41,19 +41,18 @@ class SocketListenerThread : public Thread {
data_size_(data_size),
server_(NULL),
client_(NULL),
- listening_(OS::CreateSemaphore(0)) {
+ listening_(0) {
data_ = new char[data_size_];
}
~SocketListenerThread() {
// Close both sockets.
delete client_;
delete server_;
- delete listening_;
delete[] data_;
}
void Run();
- void WaitForListening() { listening_->Wait(); }
+ void WaitForListening() { listening_.Wait(); }
char* data() { return data_; }
private:
@@ -62,7 +61,7 @@ class SocketListenerThread : public Thread {
int data_size_;
Socket* server_; // Server socket used for bind/accept.
Socket* client_; // Single client connection used by the test.
- Semaphore* listening_; // Signalled when the server socket is in listen mode.
+ Semaphore listening_; // Signalled when the server socket is in listen mode.
};
@@ -79,7 +78,7 @@ void SocketListenerThread::Run() {
// Listen for new connections.
ok = server_->Listen(1);
CHECK(ok);
- listening_->Signal();
+ listening_.Signal();
// Accept a connection.
client_ = server_->Accept();
« no previous file with comments | « test/cctest/test-semaphore.cc ('k') | test/cctest/test-thread-termination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698