Skip to content

Commit

Permalink
[nrfconnect] Stop using cooperative threads (#8025)
Browse files Browse the repository at this point in the history
nRF Connect platform used cooperative threads, that is
threads that cannot be preempted, to workaround some
synchronization issues in the past, but it's no longer
needed and is risky. The latter was revealed by #7927,
which caused that `select()` never waits (needs to be
fixed in another PR).

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
  • Loading branch information
Damian-Nordic authored and pull[bot] committed Aug 11, 2021
1 parent 4a93737 commit 4270797
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 11 deletions.
2 changes: 0 additions & 2 deletions examples/lighting-app/nrfconnect/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ int main(void)

int ret = 0;

k_thread_priority_set(k_current_get(), K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1));

ret = chip::Platform::MemoryInit();
if (ret != CHIP_NO_ERROR)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/telink/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ int main(void)
{
int ret = 0;

k_thread_priority_set(k_current_get(), K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1));

ret = chip::Platform::MemoryInit();
if (ret != CHIP_NO_ERROR)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/lock-app/nrfconnect/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ int main()
{
int ret = 0;

k_thread_priority_set(k_current_get(), K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1));

ret = chip::Platform::MemoryInit();
if (ret != CHIP_NO_ERROR)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/pump-app/nrfconnect/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ int main()
{
int ret = 0;

k_thread_priority_set(k_current_get(), K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1));

ret = chip::Platform::MemoryInit();
if (ret != CHIP_NO_ERROR)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/pump-controller-app/nrfconnect/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ int main()
{
int ret = 0;

k_thread_priority_set(k_current_get(), K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1));

ret = chip::Platform::MemoryInit();
if (ret != CHIP_NO_ERROR)
{
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
// ========== Platform-specific Configuration Overrides =========

#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY
#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY (K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1))
#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY (K_PRIO_PREEMPT(1))
#endif // CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY

#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
Expand Down

0 comments on commit 4270797

Please sign in to comment.