Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization order fiasco #67

Closed
hia3 opened this issue Sep 16, 2015 · 2 comments
Closed

Initialization order fiasco #67

hia3 opened this issue Sep 16, 2015 · 2 comments

Comments

@hia3
Copy link

hia3 commented Sep 16, 2015

Hello!

It looks like thread local context::active_ depends on another thread local - activation_record::current_rec.

image

Then it crashes

image

@olk
Copy link
Member

olk commented Sep 16, 2015

on first access current_rec is intiialized with :

static detail::activation_record * main_rec() {
thread_local static detail::activation_record rec;
return & rec;
}

thread_local
detail::activation_record::ptr_t
detail::activation_record::current_rec = main_rec();

and active_ on first access:

static context * main_context() {
static thread_local context mc;
static thread_local scheduler sched( & mc);
mc.set_scheduler( & sched);
return & mc;
}

thread_local context *
context::active_ = main_context();

@hia3
Copy link
Author

hia3 commented Sep 16, 2015

Okay. But then https://github.com/olk/boost-fiber/blob/master/doc/overview.qbk#L108 should be changed to 1.60.

@hia3 hia3 closed this as completed Sep 16, 2015
Romain-Geissler-1A pushed a commit to Romain-Geissler-1A/fiber that referenced this issue Apr 3, 2020
- define asm sources for Clang on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants