@@ -74,7 +74,7 @@ enum queue_ops {
74
74
DEQ = 1 << 0 ,
75
75
};
76
76
77
- /* regiseter the enqueuers first, dequeuers second. */
77
+ /* register the enqueuers first, dequeuers second. */
78
78
void mpmc_queue_register (mpmc_t * q , handle_t * th , int flag )
79
79
{
80
80
th -> spare = mpmc_new_node ();
@@ -122,8 +122,8 @@ static void *mpmc_find_cell(node_t *volatile *ptr, long i, handle_t *th)
122
122
{
123
123
node_t * curr = * ptr ; /* get current node */
124
124
125
- /* j is thread's local node' id (put node or pop node), (i / N) is the cell
126
- * needed node' id. and we shoud take it, By filling the nodes between the j
125
+ /* j is thread's local node id (put node or pop node), (i / N) is the cell
126
+ * needed node id. and we should take it, By filling the nodes between the j
127
127
* and (i / N) through 'next' field
128
128
*/
129
129
for (long j = curr -> id ; j < i / N ; ++ j ) {
@@ -198,8 +198,8 @@ void mpmc_enqueue(mpmc_t *q, handle_t *th, void *v)
198
198
if ((cv = __atomic_exchange_n (c , v , __ATOMIC_ACQ_REL )) == NULL )
199
199
return ;
200
200
201
- /* else the couterpart pop thread has wait this cell, so we just change the
202
- * wating value to 0 and wake it
201
+ /* else the counterpart pop thread has wait this cell, so we just change the
202
+ * waiting value to 0 and wake it
203
203
*/
204
204
* ((int * ) cv ) = 0 ;
205
205
mpmc_futex_wake (cv , 1 );
@@ -236,7 +236,7 @@ void *mpmc_dequeue(mpmc_t *q, handle_t *th)
236
236
mpmc_futex_wait (& futex_addr , 1 );
237
237
} while (futex_addr == 1 );
238
238
239
- /* the couterpart put thread has change futex_addr's value to 0. and the
239
+ /* the counterpart put thread has change futex_addr's value to 0. and the
240
240
* data has into cell(c).
241
241
*/
242
242
cv = * c ;
@@ -293,7 +293,7 @@ void *mpmc_dequeue(mpmc_t *q, handle_t *th)
293
293
if (new_id <= init_index )
294
294
/* __atomic_store_n(ptr, val, __ATOMIC_RELEASE) is a store with
295
295
* a preceding release fence to ensure all previous load and
296
- * stores completes before the current store is visiable .
296
+ * stores completes before the current store is visible .
297
297
*/
298
298
__atomic_store_n (& q -> init_id , init_index , __ATOMIC_RELEASE );
299
299
else {
0 commit comments