Skip to content
Snippets Groups Projects
Commit d794cc6d authored by t2-akhmetov's avatar t2-akhmetov
Browse files

Update example.cpp

parent dfd02dc8
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ void goo(Context* currentContext, Context* mainContext) { ...@@ -20,7 +20,7 @@ void goo(Context* currentContext, Context* mainContext) {
int* sharedData = static_cast<int*>(currentFiber->getSharedData()); int* sharedData = static_cast<int*>(currentFiber->getSharedData());
std::cout << "Address of sharedData in goo: " << sharedData << std::endl; std::cout << "Address of sharedData in goo: " << sharedData << std::endl;
std::cout << "shared Data before the increment: " << *sharedData << std::endl; std::cout << "shared Data before the increment: " << *sharedData << std::endl;
globalScheduler.yield(); // globalScheduler.yield();
*sharedData += 1; *sharedData += 1;
std::cout << "Fiber 2: " << *sharedData << std::endl; std::cout << "Fiber 2: " << *sharedData << std::endl;
globalScheduler.fiber_exit(); // Yield control back to the scheduler globalScheduler.fiber_exit(); // Yield control back to the scheduler
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment