Bug 15939 - Add currentThread API
Summary: Add currentThread API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 15935 (view as bug list)
Depends on:
Blocks: 15940
  Show dependency treegraph
 
Reported: 2007-11-10 18:37 PST by Justin Haygood
Modified: 2008-01-24 12:47 PST (History)
0 users

See Also:


Attachments
Implements currentThread API (5.57 KB, patch)
2007-11-10 18:37 PST, Justin Haygood
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Haygood 2007-11-10 18:37:28 PST
in order to get rid of all direct useages of pthread, we need a currentThread API
Comment 1 Justin Haygood 2007-11-10 18:37:56 PST
Created attachment 17179 [details]
Implements currentThread API
Comment 2 Adam Roben (:aroben) 2007-11-11 21:25:40 PST
Comment on attachment 17179 [details]
Implements currentThread API

+static ThreadIdentifier identifierByPthreadHandle(pthread_t& pthreadhandle)

The parameter should be marked const (ditto for the ThreadingGtk version).

+    for (; i != threadMap().end(); ++i) {
+        if (i->second == thread))
+            return i->first;
+    }

You don't need the braces around the body of the loop.

r=me
Comment 3 Adam Roben (:aroben) 2007-11-11 21:30:36 PST
(In reply to comment #2)
> (From update of attachment 17179 [details] [edit])
> +    for (; i != threadMap().end(); ++i) {
> +        if (i->second == thread))
> +            return i->first;
> +    }
> 
> You don't need the braces around the body of the loop.

Please disregard this. The braces are correct per our style guidelines <http://webkit.org/coding/coding-style.html>.
Comment 4 Mark Rowe (bdash) 2007-11-11 21:58:54 PST
Landed in r27707 after some fixes to the gthreads version and improvements to match the style guidelines.
Comment 5 Alexey Proskuryakov 2008-01-24 12:47:22 PST
*** Bug 15935 has been marked as a duplicate of this bug. ***