Skip to content

Commit

Permalink
kernel: Deprecate CONFIG_MULTITHREADING
Browse files Browse the repository at this point in the history
Deprecate the Kconfig option for the time being. Unless a contributor
volunteers to take over the work to maintain the option, it will be
removed after 2 releases.

Relates to #27415.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
  • Loading branch information
carlescufi authored and MaureenHelm committed Sep 23, 2020
1 parent 4042a7c commit 28cb9da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ if(${CONFIG_KERNEL_MEM_POOL})
endif()
endif()

if(NOT CONFIG_MULTITHREADING)
message(WARNING "Single threaded mode (CONFIG_MULTITHREADING=n) is deprecated")
endif()

# The last 2 files inside the target_sources_ifdef should be
# userspace_handler.c and userspace.c. If not the linker would complain.
# This order has to be maintained. Any new file should be placed
Expand Down
9 changes: 8 additions & 1 deletion kernel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ module-str = kernel
source "subsys/logging/Kconfig.template.log_config"

config MULTITHREADING
bool "Multi-threading"
bool "Multi-threading (DEPRECATED)"
default y
help
Disabling this option is DEPRECATED.

If disabled, only the main thread is available, so a main() function
must be provided. Interrupts are available. Kernel objects will most
probably not behave as expected, especially with regards to pending,
Expand All @@ -23,6 +25,11 @@ config MULTITHREADING
set to 'n'; disable only when you REALLY know what you are
doing.

if !MULTITHREADING
comment "*** WARNING ***"
comment "Single threaded mode (MULTITHREADING option disabled) is deprecated"
endif

config NUM_COOP_PRIORITIES
int "Number of coop priorities" if MULTITHREADING
default 1 if !MULTITHREADING
Expand Down
1 change: 1 addition & 0 deletions samples/hello_world/prj.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# nothing here
CONFIG_MULTITHREADING=n

0 comments on commit 28cb9da

Please sign in to comment.