Skip to content

Commit 1a3ce7e

Browse files
committed
MDEV-23651: Fix the Windows build
In the Microsoft environment, my_atomic requires int32.
1 parent a7dd7c8 commit 1a3ce7e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

storage/innobase/include/fil0fil.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
142142
The most significant bit contains the STOP_NEW_OPS flag.
143143
144144
Protected by my_atomic. */
145-
uint32_t n_pending_ops;
145+
int32 n_pending_ops;
146146

147147
/** Flag in n_pending_ops that indicates that the tablespace is being
148148
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;
150150
public:
151151
/** Number of pending block read or write operations
152152
(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>,
263263
void close();
264264

265265
/** @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()
267267
{
268268
return my_atomic_load32(&n_pending_ops);
269269
}
270270

271271
/** @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
273273
{
274274
return const_cast<fil_space_t*>(this)->is_stopping_or_referenced();
275275
}
@@ -281,7 +281,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
281281
}
282282

283283
/** @return number of references being held */
284-
uint32_t referenced() const
284+
int32 referenced() const
285285
{
286286
return is_stopping_or_referenced() & ~STOP_NEW_OPS;
287287
}
@@ -290,7 +290,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
290290
void set_stopping(bool stopping)
291291
{
292292
/* 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;
294294
while (!my_atomic_cas32_strong_explicit(&n_pending_ops, &n,
295295
n ^ STOP_NEW_OPS,
296296
MY_MEMORY_ORDER_ACQUIRE,
@@ -302,7 +302,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
302302
/** @return whether a tablespace reference was successfully acquired */
303303
bool acquire()
304304
{
305-
uint32_t n= 0;
305+
int32 n= 0;
306306
while (!my_atomic_cas32_strong_explicit(&n_pending_ops, &n, n + 1,
307307
MY_MEMORY_ORDER_ACQUIRE,
308308
MY_MEMORY_ORDER_RELAXED))
@@ -314,7 +314,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
314314
@return whether this was the last reference */
315315
bool release()
316316
{
317-
uint32_t n= my_atomic_add32(&n_pending_ops, uint32_t(-1));
317+
int32 n= my_atomic_add32(&n_pending_ops, -1);
318318
ut_ad(n & ~STOP_NEW_OPS);
319319
return (n & ~STOP_NEW_OPS) == 1;
320320
}

0 commit comments

Comments
 (0)