From: Arnaud Giersch Date: Tue, 11 Oct 2022 12:50:14 +0000 (+0200) Subject: Actor::create already does init->start. X-Git-Tag: v3.34~783 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/00818add3016bc2e7853515bc8103ff5fef7a315 Actor::create already does init->start. --- diff --git a/examples/sthread/pthread-mutex-simple.tesh b/examples/sthread/pthread-mutex-simple.tesh index 1dd09bd29b..29d66a92df 100644 --- a/examples/sthread/pthread-mutex-simple.tesh +++ b/examples/sthread/pthread-mutex-simple.tesh @@ -1,7 +1,7 @@ $ env ASAN_OPTIONS=verify_asan_link_order=0:$ASAN_OPTIONS LD_PRELOAD=${libdir:=.}/libsthread.so ./pthread-mutex-simple > [0.000000] [sthread/INFO] Starting the simulation. -> The thread 0 is terminating. > All threads are started. +> The thread 0 is terminating. > The thread 1 is terminating. > User's main is terminating. > [0.000000] [sthread/INFO] All threads exited. Terminating the simulation. diff --git a/src/sthread/sthread_impl.cpp b/src/sthread/sthread_impl.cpp index 7721982343..9eb1a91ff6 100644 --- a/src/sthread/sthread_impl.cpp +++ b/src/sthread/sthread_impl.cpp @@ -83,8 +83,7 @@ int sthread_create(unsigned long int* thread, const void* /*pthread_attr_t* attr MPI_Comm_rank(MPI_COMM_WORLD, &rank); #endif std::string name = simgrid::xbt::string_printf("%d:%d", rank, TID); - sg4::ActorPtr actor = sg4::Actor::init(name.c_str(), lilibeth); - actor->start(thread_create_wrapper, start_routine, arg); + sg4::ActorPtr actor = sg4::Actor::create(name, lilibeth, thread_create_wrapper, start_routine, arg); intrusive_ptr_add_ref(actor.get()); *thread = reinterpret_cast(actor.get());