]> git.droids-corp.org - dpdk.git/commit
eal/windows: fix data race when creating threads
authorTyler Retzlaff <roretzla@linux.microsoft.com>
Thu, 10 Mar 2022 07:35:08 +0000 (23:35 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 30 Mar 2022 17:01:52 +0000 (19:01 +0200)
commite4e983b975df700474309605b6adb5f2c6d83e2f
tree7e5786e761a0d71cefdf80676608c190d1bd17bb
parentf6ecec2b91c3a68d8cb52c5c3c347e6a8711420e
eal/windows: fix data race when creating threads

eal_thread_loop() uses lcore_config[i].thread_id,
which is stored upon the return from CreateThread().
Per documentation, eal_thread_loop() can start
before CreateThread() returns and the ID is stored.

Create lcore worker threads suspended and then subsequently resume to
allow &lcore_config[i].thread_id be stored before eal_thread_loop
execution.

Fixes: 53ffd9f080fc ("eal/windows: add minimum viable code")
Cc: stable@dpdk.org
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
lib/eal/windows/eal_thread.c