@@ -142,11 +142,11 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
142
142
The most significant bit contains the STOP_NEW_OPS flag.
143
143
144
144
Protected by my_atomic. */
145
- uint32_t n_pending_ops;
145
+ int32 n_pending_ops;
146
146
147
147
/* * Flag in n_pending_ops that indicates that the tablespace is being
148
148
deleted, and no further operations should be performed */
149
- static const uint32_t STOP_NEW_OPS= 1U << 31 ;
149
+ static const int32 STOP_NEW_OPS= 1 << 31 ;
150
150
public:
151
151
/* * Number of pending block read or write operations
152
152
(when a write is imminent or a read has recently completed).
@@ -263,13 +263,13 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
263
263
void close ();
264
264
265
265
/* * @return whether the tablespace is about to be dropped or is referenced */
266
- uint32_t is_stopping_or_referenced ()
266
+ int32 is_stopping_or_referenced ()
267
267
{
268
268
return my_atomic_load32 (&n_pending_ops);
269
269
}
270
270
271
271
/* * @return whether the tablespace is about to be dropped or is referenced */
272
- uint32_t is_stopping_or_referenced () const
272
+ int32 is_stopping_or_referenced () const
273
273
{
274
274
return const_cast <fil_space_t *>(this )->is_stopping_or_referenced ();
275
275
}
@@ -281,7 +281,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
281
281
}
282
282
283
283
/* * @return number of references being held */
284
- uint32_t referenced () const
284
+ int32 referenced () const
285
285
{
286
286
return is_stopping_or_referenced () & ~STOP_NEW_OPS;
287
287
}
@@ -290,7 +290,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
290
290
void set_stopping (bool stopping)
291
291
{
292
292
/* Note: starting with 10.4 this should be std::atomic::fetch_xor() */
293
- uint32_t n= stopping ? 0 : STOP_NEW_OPS;
293
+ int32 n= stopping ? 0 : STOP_NEW_OPS;
294
294
while (!my_atomic_cas32_strong_explicit (&n_pending_ops, &n,
295
295
n ^ STOP_NEW_OPS,
296
296
MY_MEMORY_ORDER_ACQUIRE,
@@ -302,7 +302,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
302
302
/* * @return whether a tablespace reference was successfully acquired */
303
303
bool acquire ()
304
304
{
305
- uint32_t n= 0 ;
305
+ int32 n= 0 ;
306
306
while (!my_atomic_cas32_strong_explicit (&n_pending_ops, &n, n + 1 ,
307
307
MY_MEMORY_ORDER_ACQUIRE,
308
308
MY_MEMORY_ORDER_RELAXED))
@@ -314,7 +314,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
314
314
@return whether this was the last reference */
315
315
bool release ()
316
316
{
317
- uint32_t n= my_atomic_add32 (&n_pending_ops, uint32_t (- 1 ) );
317
+ int32 n= my_atomic_add32 (&n_pending_ops, - 1 );
318
318
ut_ad (n & ~STOP_NEW_OPS);
319
319
return (n & ~STOP_NEW_OPS) == 1 ;
320
320
}
0 commit comments