Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MutliThread Server_Multi_Client HelloWorld C027_SupportTest ... more
Threads.h@2:46b56c9086f2, 2013-06-29 (annotated)
- Committer:
- lemniskata
- Date:
- Sat Jun 29 22:05:28 2013 +0000
- Revision:
- 2:46b56c9086f2
- Parent:
- 0:266b0dc4f8d0
- Child:
- 3:d370bed31f45
Creating and running multiple thread instances of the same function. All running threads are stored in a list with their osThreadId
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| lemniskata | 0:266b0dc4f8d0 | 1 | /* |
| lemniskata | 0:266b0dc4f8d0 | 2 | ** File name: Thread.cpp |
| lemniskata | 0:266b0dc4f8d0 | 3 | ** Descriptions: Creates multiple thread instances of the same function |
| lemniskata | 0:266b0dc4f8d0 | 4 | ** |
| lemniskata | 0:266b0dc4f8d0 | 5 | **------------------------------------------------------------------------------------------------------ |
| lemniskata | 0:266b0dc4f8d0 | 6 | ** Created by: Ivan Shindev |
| lemniskata | 0:266b0dc4f8d0 | 7 | ** Created date: 06/29/2013 |
| lemniskata | 0:266b0dc4f8d0 | 8 | ** Version: 1.0 |
| lemniskata | 0:266b0dc4f8d0 | 9 | ** Descriptions: The original version |
| lemniskata | 0:266b0dc4f8d0 | 10 | ** |
| lemniskata | 0:266b0dc4f8d0 | 11 | **------------------------------------------------------------------------------------------------------ |
| lemniskata | 0:266b0dc4f8d0 | 12 | ** Modified by: |
| lemniskata | 0:266b0dc4f8d0 | 13 | ** Modified date: |
| lemniskata | 0:266b0dc4f8d0 | 14 | ** Version: |
| lemniskata | 0:266b0dc4f8d0 | 15 | ** Descriptions: |
| lemniskata | 0:266b0dc4f8d0 | 16 | */ |
| lemniskata | 0:266b0dc4f8d0 | 17 | #ifndef __Threads_H |
| lemniskata | 0:266b0dc4f8d0 | 18 | #define __Threads_H |
| lemniskata | 0:266b0dc4f8d0 | 19 | |
| lemniskata | 0:266b0dc4f8d0 | 20 | #include "mbed.h" |
| lemniskata | 0:266b0dc4f8d0 | 21 | #include "cmsis_os.h" |
| lemniskata | 0:266b0dc4f8d0 | 22 | |
| lemniskata | 2:46b56c9086f2 | 23 | typedef struct ThreadList |
| lemniskata | 2:46b56c9086f2 | 24 | { |
| lemniskata | 2:46b56c9086f2 | 25 | osThreadDef_t *thread; |
| lemniskata | 2:46b56c9086f2 | 26 | osThreadId id; |
| lemniskata | 2:46b56c9086f2 | 27 | struct ThreadList* nextThread; |
| lemniskata | 2:46b56c9086f2 | 28 | }ThreadList; |
| lemniskata | 2:46b56c9086f2 | 29 | |
| lemniskata | 2:46b56c9086f2 | 30 | int initThread(ThreadList **addresOfTL,os_pthread pthread,ThreadList** addresOfThread); |
| lemniskata | 2:46b56c9086f2 | 31 | |
| lemniskata | 0:266b0dc4f8d0 | 32 | #endif |