GitHub PullRequestReviewCommentEvent at 2014-05-26 02:23:07
Repository: druntime
Actor: yglukhov
Payload: {"comment":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/13034600","id":13034600,"diff_hunk":"@@ -214,48 +317,46 @@ version( USE_PTHREADS )\n          */\n \n         debug(PRINTF) printf(\"+_d_monitor_create(%p)\\n\", h);\n-        assert(h);\n-        Monitor *cs;\n         pthread_mutex_lock(&_monitor_critsec);\n-        if (!h.__monitor)\n+        Monitor* cs = getMonitor(h);\n+        if (!cs)\n         {\n             cs = cast(Monitor *)calloc(Monitor.sizeof, 1);\n             assert(cs);\n             pthread_mutex_init(&cs.mon, &_monitors_attr);\n             setMonitor(h, cs);\n             cs.refs = 1;\n-            cs = null;\n+            typeid(h).m_flags |= TypeInfo_Class.ClassFlags.hasAllocatedMonitors;","path":"src/rt/monitor_.d","position":237,"original_position":237,"commit_id":"925b5fc3f23ed56c2d22a7b7423c41424ec713e0","original_commit_id":"925b5fc3f23ed56c2d22a7b7423c41424ec713e0","user":{"login":"yglukhov","id":6962409,"avatar_url":"https://avatars.githubusercontent.com/u/6962409?","gravatar_id":"71b7b08fbc2f989a8246913ac608cca9","url":"https://api.github.com/users/yglukhov","html_url":"https://github.com/yglukhov","followers_url":"https://api.github.com/users/yglukhov/followers","following_url":"https://api.github.com/users/yglukhov/following{/other_user}","gists_url":"https://api.github.com/users/yglukhov/gists{/gist_id}","starred_url":"https://api.github.com/users/yglukhov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yglukhov/subscriptions","organizations_url":"https://api.github.com/users/yglukhov/orgs","repos_url":"https://api.github.com/users/yglukhov/repos","events_url":"https://api.github.com/users/yglukhov/events{/privacy}","received_events_url":"https://api.github.com/users/yglukhov/received_events","type":"User","site_admin":false},"body":"The idea behind this is to skip monitor finalization for types that never have a monitor. The flag is used in rt_finalize2. Otherwise all types that do not have explicit monitors would suffer a pointless hash-table lookup on finalization.","created_at":"2014-05-26T02:23:07Z","updated_at":"2014-05-26T02:23:07Z","html_url":"https://github.com/D-Programming-Language/druntime/pull/789#discussion_r13034600","pull_request_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/789","_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/13034600"},"html":{"href":"https://github.com/D-Programming-Language/druntime/pull/789#discussion_r13034600"},"pull_request":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/789"}}}}