1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

42 Commits

Author SHA1 Message Date
JulianHolzwarth
31b3aeb48c sys/posix/pthread/pthread.c: Reaper fix
before the reaper was never created
2019-09-20 15:07:48 +02:00
JulianHolzwarth
d76bb689d6 sys/posix/pthread/pthread.c: pthread_create fix
The function insert returns KERNEL_PID_UNDEF now because pthread_create checks for it.
In pthread_create it checks now if thread_create returns a valid pid
2019-09-06 15:54:59 +02:00
998fd6bcc9
sys/pthread: deduplicate pthread group definition 2019-08-05 16:57:36 +02:00
smlng
6b0491eca2 sys/posix: fix intentional fallthrough in pthread 2018-01-16 13:21:24 +01:00
Philippe Coval
20c3aaa448 sys: Fix pthread includes to support avr-libs
Missing malloc.h and clock_id_t were causing issues to build.

It was tested with this configuration:

- linux ubuntu 14.04.5
- arduino-mega2560 board
- avr-libc-1.8.0-4.1

This change was needed to build iotivity example

Bug: https://github.com/RIOT-OS/RIOT/issues/6241
Change-Id: I82ce246093b3467dfe9746f999bcc9335dbb65f6
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
2017-01-17 19:44:22 +01:00
7718f114cb all: remove pointer casts for msg.content.ptr 2016-06-02 23:13:42 +02:00
DipSwitch
21edec412a posix: Remove _t from struct names 2016-04-11 21:46:54 +02:00
f626ee5969 Merge pull request #4557 from kaspar030/introduce_intrusive_singly_linked_list
core: mutex: several optimizations
2016-03-29 22:25:43 +02:00
c0f39bb55f sys: posix: pthread: fix mutex usage 2016-03-29 21:50:17 +02:00
Yonezawa-T2
1ce140d910 debug: fix compilation error for %p formatter 2016-03-29 11:46:29 +09:00
DipSwitch
0bb4748a94 core: Fix/refactor function naming in core/incude/irq.h 2016-03-20 16:47:34 +01:00
9082273746 core: header cleanup 2016-02-28 22:46:28 +01:00
Hauke Petersen
41979b64cd sys: adapted to renamed THREAD FLAGS 2015-12-07 22:09:47 +01:00
Joakim Gebart
0cfe6d15dc sys/posix/pthread: Replace dINT by disableIRQ 2015-09-19 10:35:58 +02:00
Hauke Petersen
9943f51080 global: renamed cpu-conf.h into cpu_conf.h 2015-05-28 15:45:05 +02:00
Lucas Jenss
426170b064 Improve naming of thread stacksize/priority constants
As discussed in #2725, this commit renames a number of stacksize constants to
better convey their intended usage. In addition, constants for thread priority
are given a `THREAD_` prefix. Changes are:

* KERNEL_CONF_STACKSIZE_PRINTF renamed to THREAD_EXTRA_STACKSIZE_PRINTF
* KERNEL_CONF_STACKSIZE_DEFAULT renamed to THREAD_STACKSIZE_DEFAULT
* KERNEL_CONF_STACKSIZE_IDLE renamed to THREAD_STACKSIZE_IDLE
* KERNEL_CONF_STACKSIZE_MAIN renamed to THREAD_STACKSIZE_MAIN
* Move thread stacksizes from kernel.h to thread.h, since the prefix changed
* PRIORITY_MIN renamed to THREAD_PRIORITY_MIN
* PRIORITY_IDLE renamed to THREAD_PRIORITY_IDLE
* PRIORITY_MAIN renamed to THREAD_PRIORITY_MAIN
* Move thread priorities from kernel.h to thread.h since the prefix has changed
* MINIMUM_STACK_SIZE renamed to THREAD_STACKSIZE_MINIMUM for consistency
2015-05-21 00:14:23 +02:00
Martin Landsmann
6e90ad6d73 sys/posix/pthread: added dynamic pthread thread local storage 2015-01-27 23:04:12 +01:00
Oleg Hahm
1de5c2b4a0 fixed remaining variables to kernel_pid_t 2014-08-07 17:29:53 +02:00
Oleg Hahm
74fbff1df2 net: changed name of internal variable
To avoid naming conflicts + made variable static and volatile as it
should be.
2014-08-07 16:31:27 +02:00
Oleg Hahm
0ad7b170ed make kernel_pid_t comparisons consistent 2014-08-07 16:31:27 +02:00
Oleg Hahm
aa2ecf6216 initialize kernel_pid_t correctly 2014-08-07 16:31:27 +02:00
Oleg Hahm
c2b0423918 core: renamed KERNEL_PID_NULL to KERNEL_PID_UNDEF
As @authmillenon pointed out the "null" in the old name is somewhat
misleading, since the actual value is -1.
2014-08-07 16:31:27 +02:00
Ludwig Ortmann
c2b2e4554b core/queue: queue -> priority_queue
Rename queue to priority queue, because that's what it is.
2014-08-05 17:57:45 +02:00
Oleg Hahm
983d056c75 core: harmonizes the data type for the process ID
Instead of using differing integer types use kernel_pid_t for process
identifier. This type is introduced in a new header file to avoid
circular dependencies.
2014-08-01 12:02:54 +02:00
Ludwig Ortmann
3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 2014-07-31 22:57:20 +02:00
René Kijewski
ba1a15535b core: remove extra thread_create_arg() function 2014-07-09 10:28:23 +02:00
René Kijewski
a6fd5bff92 core: imply current_prio in sched_switch()
There is no need to supply the current priority to `sched_switch()`,
when this function can easily tell the value of
`active_thread->priority` itself.
2014-05-24 16:48:35 +02:00
Oleg Hahm
ef5ec344fd core: prefix API functions correctly
Also changed names for bitarithm functions and rename thread_pid to sched_active_pid.
2014-05-18 08:53:20 +02:00
Ludwig Ortmann
2314915ff2 license: fix license header grammar
insert missing "is"
2014-05-14 09:49:09 +02:00
Martin
fc532ad891 added else branch in pthread_exit() to avoid calling explicit return;
however, this won't help to completely eliminate the warning on returning from a `noreturn` function
2014-04-30 07:22:48 +02:00
BytesGalore
9d4d98c9ea Merge pull request #1025 from BytesGalore/add_out_of_bounds_check
sys:posix:pthread added check to avoid array out of bound access
2014-04-25 18:00:07 +02:00
Martin
345e76a0d7 added check to avoid array out of boud access 2014-04-25 17:57:41 +02:00
René Kijewski
3e6bebadd3 Add missing doxygen for pthread funs and structs 2014-04-18 03:19:31 +02:00
Martin
e159d0b38a changed return value to 0 on lookup fail in pthread_self() 2014-04-17 14:31:36 +02:00
Martin
f3566f0b8a changed pthread_self() to return thread IDs > 0 2014-04-16 17:31:47 +02:00
René Kijewski
b54962689a posix: Add pthread_cleanup handlers
With `pthread_cleanup_(push|pop)` you can define a function that should
be ran if the thread is exited while it is inside this scope. A thread
can be ended here through an explicit call to `pthread_exit()`, or if
cancellation was requested and a cancellation point was hit.

`pthread_cleanup_*` is mostly only useful together with cancellation
points, and cancellation points are only useful with a cleanup
functionality. Cancellation points are at least partially implemented by
means of `pthread_testcancel()`.

C.f. ["Cancellation Points"][1].

  [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_05_02
2014-04-04 18:03:29 +02:00
René Kijewski
46031a0540 posix: Disable debug output of pthreads
`DEBUG_ENABLED` should be enabled during debugging, and disabled
afterwards.
2014-03-03 22:12:25 +01:00
Oleg Hahm
32f918abe8 simplified sched_switch
sched_switch can check ISR itself.
2014-02-25 09:47:58 +01:00
Christian Mehlis
2de9619f21 Merge pull request #758 from Kijewski/issue-755
Fix `pthread_self()` confusion
2014-02-22 18:30:11 +01:00
René Kijewski
ca4337ab4d Fix pthread_self() confusion
This fixes #755.

The pthread ID cannot be reused as soon as the thread ends, because
another thread needs to join it first. `pthread_self()` uses the native
(i.e. RIOT's) thread ID to distinguish itself. A native thread ID can be
reused as soon as the thread ends, since the core knows no join
operation.

In order to not confuse itself with an earlier zombie thread (i.e a dead
non-detached thread, that was not joined, yet), we need to invalidate
the associated native thread ID.

This approach is sane since a dead thread won't call `pthread_self()`
anymore.
2014-02-21 17:44:08 +01:00
René Kijewski
cb423c0ac4 Fix linkage of pthread_reaper_stack 2014-02-21 14:03:55 +01:00
Christian Mehlis
e865022a31 pthread: initial add 2014-02-19 23:39:38 +01:00