Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #6173 > unrolled thread

std::system_error of std::call_once

Started byyuan lu <luqk1127@gmail.com>
First post2020-12-16 22:09 -0800
Last post2020-12-17 13:47 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.programming.threads


Contents

  std::system_error of std::call_once yuan lu <luqk1127@gmail.com> - 2020-12-16 22:09 -0800
    Re: std::system_error of std::call_once Bonita Montero <Bonita.Montero@gmail.com> - 2020-12-17 13:47 +0100

#6173 — std::system_error of std::call_once

Fromyuan lu <luqk1127@gmail.com>
Date2020-12-16 22:09 -0800
Subjectstd::system_error of std::call_once
Message-ID<986b2c93-bdd0-48df-85b3-f6c534334c22n@googlegroups.com>
When i use std::call_once in Linux version 2.6.36,it makes an error:

terminate called after throwing an instance of 'std::system_error'
        what():  Unknown error -1
Aborted

Compile command:
mipsel-buildroot-linux-uclibc-g++ callonce.cpp -o callonce -static -lpthread

thanks.

[toc] | [next] | [standalone]


#6174

FromBonita Montero <Bonita.Montero@gmail.com>
Date2020-12-17 13:47 +0100
Message-ID<rrfk0t$bhs$1@dont-email.me>
In reply to#6173
Am 17.12.2020 um 07:09 schrieb yuan lu:
> When i use std::call_once in Linux version 2.6.36,it makes an error:
> terminate called after throwing an instance of 'std::system_error'
>          what():  Unknown error -1
> Aborted

Then an exception happened in a thread which isn't caught. I think
call_once is specified to throw an exception because that might be
thrown also when you enter a critical secton protected by a mutex;
and call_once potects this once_flax with a mutex for sure.
So there are two potential ways in which this exception might have
thrown: by locking that mutex or other code which is inside the
function-object you call.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming.threads


csiph-web