Hello andreip, nicolasroard,
I'd like you to do a code review. Please execute
g4 diff -c 8835874
or point your web browser to
http://mondrian/8835874
(this changelist has been uploaded to Mondrian)
to review the following code:
Change 8835874 by [EMAIL PROTECTED] on 2008/11/03 11:39:25 *pending*
Check Join() is not called by the child thread.
Check that Thread::Join() is not called by the child thread,
as this would deadlock.
PRESUBMIT=passed
R=andreip,nicolasroard
[EMAIL PROTECTED]
DELTA=9 (8 added, 0 deleted, 1 changed)
OCL=8835874
Affected files ...
... //depot/googleclient/gears/opensource/gears/base/common/thread.cc#3 edit
... //depot/googleclient/gears/opensource/gears/base/common/thread.h#3 edit
9 delta lines: 8 added, 0 deleted, 1 changed
Also consider running:
g4 lint -c 8835874
which verifies that the changelist doesn't introduce new style violations.
If you can't do the review, please let me know as soon as possible. During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately. Visit
http://www/eng/code_review.html for more information.
This is a semiautomated message from "g4 mail". Complaints or suggestions?
Mail [EMAIL PROTECTED]
Change 8835874 by [EMAIL PROTECTED] on 2008/11/03 11:39:25 *pending*
Check Join() is not called by the child thread.
Check that Thread::Join() is not called by the child thread,
as this would deadlock.
Affected files ...
... //depot/googleclient/gears/opensource/gears/base/common/thread.cc#3 edit
... //depot/googleclient/gears/opensource/gears/base/common/thread.h#3 edit
==== //depot/googleclient/gears/opensource/gears/base/common/thread.cc#3 -
/usr/local/google/home/jripley/gears-trunk3/googleclient/gears/opensource/gears/base/common/thread.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/common/thread.cc 2008-10-22
15:54:23.000000000 +0100
+++ googleclient/gears/opensource/gears/base/common/thread.cc 2008-11-03
11:37:58.000000000 +0000
@@ -65,7 +65,13 @@
void Thread::Join() {
if (thread_id_ != 0) {
+#ifdef BROWSER_NONE
+#else
// Wait for the child thread to terminate, and free its resources.
+ // Cannot be called by the child thread as this would deadlock.
+ assert(ThreadMessageQueue::GetInstance()->GetCurrentThreadId()
+ != thread_id_);
+#endif
internal_->Join();
thread_id_ = 0;
}
==== //depot/googleclient/gears/opensource/gears/base/common/thread.h#3 -
/usr/local/google/home/jripley/gears-trunk3/googleclient/gears/opensource/gears/base/common/thread.h
====
# action=edit type=text
--- googleclient/gears/opensource/gears/base/common/thread.h 2008-11-03
11:38:09.000000000 +0000
+++ googleclient/gears/opensource/gears/base/common/thread.h 2008-11-03
11:37:45.000000000 +0000
@@ -52,7 +52,9 @@
// Waits for the Run method to complete, freeing any OS-specific
// thread handle resources associated with the child thread. Must be
- // called before destruction if a thread was started successfully.
+ // called before destruction if a thread was started
+ // successfully. Cannot be called by the child thread as this would
+ // deadlock.
void Join();
// Returns true if the child thread is running.
bool IsRunning() const { return is_running_; }