This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++14 status.

### 2143. `ios_base::xalloc` should be thread-safe

Section: 29.5.2 [ios.base] Status: C++14 Submitter: Alberto Ganesh Barbati Opened: 2012-03-14 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [ios.base].

View all issues with C++14 status.

Discussion:

The static function `ios_base::xalloc()` could be called from multiple threads and is not covered by 16.4.5.10 [res.on.objects] and 16.4.6.10 [res.on.data.races]. Adding a thread-safety requirement should not impose a significant burden on implementations, as the function can be easily implemented with hopefully lock-free atomics.

[2013-04-20, Bristol]

Unanimous.

Resolution: move tentatively ready. (Inform Bill about this issue.)

[2013-09-29, Chicago]

Apply to Working Paper

Proposed resolution:

This wording is relative to N3376.

1. In 29.5.2.6 [ios.base.storage] add a new paragraph after paragraph 1:

   >     static int xalloc();

   > > -1- Returns: `index ++`.

   > > -?- Remarks: Concurrent access to this function by multiple threads shall not result in a data race (6.9.2 [intro.multithread]).