This repository was archived by the owner on May 20, 2025. It is now read-only.
Commit 34ecec9
committed
Atomically delete object queue only when empty
Once the threads object queue is empty, other threads may explicitly
merge reference counts immediately. It's no longer safe for the original
thread to do RC operations because of races with accesses to ob_ref_local.
This ensures that the queue is empty when it's removed from the hashtable
mapping thread-id to queue. There are still other RC operations that can
happen during thread destruction, so the call to _Py_queue_destroy will
probably need to be moved.
See #501 parent 605f207 commit 34ecec9
1 file changed
Lines changed: 20 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 25 | | |
43 | 26 | | |
44 | 27 | | |
| |||
68 | 51 | | |
69 | 52 | | |
70 | 53 | | |
71 | | - | |
72 | | - | |
73 | 54 | | |
74 | 55 | | |
75 | 56 | | |
76 | 57 | | |
77 | 58 | | |
78 | 59 | | |
| 60 | + | |
79 | 61 | | |
80 | 62 | | |
81 | 63 | | |
82 | 64 | | |
83 | 65 | | |
84 | | - | |
85 | | - | |
86 | 66 | | |
87 | 67 | | |
88 | 68 | | |
89 | | - | |
90 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
91 | 73 | | |
92 | 74 | | |
93 | 75 | | |
| |||
98 | 80 | | |
99 | 81 | | |
100 | 82 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
104 | 88 | | |
105 | 89 | | |
106 | 90 | | |
| |||
131 | 115 | | |
132 | 116 | | |
133 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
134 | 124 | | |
135 | 125 | | |
136 | 126 | | |
137 | 127 | | |
138 | 128 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
142 | 133 | | |
143 | 134 | | |
144 | 135 | | |
| |||
147 | 138 | | |
148 | 139 | | |
149 | 140 | | |
150 | | - | |
151 | | - | |
152 | 141 | | |
0 commit comments