Skip to content
Snippets Groups Projects
YieldToAnywhereTest.cpp 382 B
Newer Older
  • Learn to ignore specific revisions
  • // SPDX-License-Identifier: LGPL-3.0-or-later
    
    // Copyright © 2020-2021 Florian Schmaus
    
    #include "CountingPrivateSemaphore.hpp"
    #include "emper.hpp"
    
    void emperTest() {
    	const unsigned fiberCount = 100;
    	CPS cps;
    	for (unsigned i = 0; i < fiberCount; ++i) {
    		spawn(
    				[] {
    					for (unsigned i = 0; i < 100; ++i) {
    						emper::yield();
    					}
    				},
    				cps);
    	}
    	cps.wait();
    }