parent
1518d6ac64
commit
06a86aef20
@ -78,7 +78,10 @@ static void riot_ccn_appserver(int argc, char **argv)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
appserver_pid = thread_create(appserver_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1, CREATE_STACKTEST, appserver_thread, "appserver");
|
appserver_pid = thread_create(
|
||||||
|
appserver_stack, sizeof(appserver_stack),
|
||||||
|
PRIORITY_MAIN - 1, CREATE_STACKTEST,
|
||||||
|
appserver_thread, "appserver");
|
||||||
DEBUG("ccn-lite appserver on thread_id %d...\n", appserver_pid);
|
DEBUG("ccn-lite appserver on thread_id %d...\n", appserver_pid);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -163,7 +166,10 @@ static void riot_ccn_relay_start(int argc, char **argv)
|
|||||||
shell_threshold_aggregate = atoi(argv[3]);
|
shell_threshold_aggregate = atoi(argv[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
relay_pid = thread_create(relay_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 2, CREATE_STACKTEST, relay_thread, "relay");
|
relay_pid = thread_create(
|
||||||
|
relay_stack, sizeof(relay_stack),
|
||||||
|
PRIORITY_MAIN - 2, CREATE_STACKTEST,
|
||||||
|
relay_thread, "relay");
|
||||||
DEBUG("ccn-lite relay on thread_id %d...\n", relay_pid);
|
DEBUG("ccn-lite relay on thread_id %d...\n", relay_pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ void init_transceiver(void)
|
|||||||
{
|
{
|
||||||
int radio_pid = thread_create(
|
int radio_pid = thread_create(
|
||||||
radio_stack_buffer,
|
radio_stack_buffer,
|
||||||
RADIO_STACK_SIZE,
|
sizeof(radio_stack_buffer),
|
||||||
PRIORITY_MAIN - 2,
|
PRIORITY_MAIN - 2,
|
||||||
CREATE_STACKTEST,
|
CREATE_STACKTEST,
|
||||||
radio,
|
radio,
|
||||||
|
|||||||
@ -87,7 +87,10 @@ void rpl_udp_init(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBUGF("Start monitor\n");
|
DEBUGF("Start monitor\n");
|
||||||
int monitor_pid = thread_create(monitor_stack_buffer, MONITOR_STACK_SIZE, PRIORITY_MAIN - 2, CREATE_STACKTEST, rpl_udp_monitor, "monitor");
|
int monitor_pid = thread_create(
|
||||||
|
monitor_stack_buffer, sizeof(monitor_stack_buffer),
|
||||||
|
PRIORITY_MAIN - 2, CREATE_STACKTEST,
|
||||||
|
rpl_udp_monitor, "monitor");
|
||||||
DEBUGF("Register at transceiver %02X\n", TRANSCEIVER);
|
DEBUGF("Register at transceiver %02X\n", TRANSCEIVER);
|
||||||
transceiver_register(TRANSCEIVER, monitor_pid);
|
transceiver_register(TRANSCEIVER, monitor_pid);
|
||||||
ipv6_register_packet_handler(monitor_pid);
|
ipv6_register_packet_handler(monitor_pid);
|
||||||
|
|||||||
@ -47,7 +47,10 @@ void udp_server(int argc, char **argv)
|
|||||||
(void) argc;
|
(void) argc;
|
||||||
(void) argv;
|
(void) argv;
|
||||||
|
|
||||||
int udp_server_thread_pid = thread_create(udp_server_stack_buffer, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN, CREATE_STACKTEST, init_udp_server, "init_udp_server");
|
int udp_server_thread_pid = thread_create(
|
||||||
|
udp_server_stack_buffer, sizeof(udp_server_stack_buffer),
|
||||||
|
PRIORITY_MAIN, CREATE_STACKTEST,
|
||||||
|
init_udp_server, "init_udp_server");
|
||||||
printf("UDP SERVER ON PORT %d (THREAD PID: %d)\n", HTONS(SERVER_PORT), udp_server_thread_pid);
|
printf("UDP SERVER ON PORT %d (THREAD PID: %d)\n", HTONS(SERVER_PORT), udp_server_thread_pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
busy = 1;
|
busy = 1;
|
||||||
k = 23;
|
k = 23;
|
||||||
thread_create(busy_stack, KERNEL_CONF_STACKSIZE_MAIN,
|
thread_create(busy_stack, sizeof(busy_stack),
|
||||||
PRIORITY_MAIN + 1, CREATE_WOUT_YIELD, busy_thread,
|
PRIORITY_MAIN + 1, CREATE_WOUT_YIELD, busy_thread,
|
||||||
"busy_thread");
|
"busy_thread");
|
||||||
puts("busy_thread created");
|
puts("busy_thread created");
|
||||||
|
|||||||
@ -43,7 +43,7 @@ int main(void)
|
|||||||
mutex_init(&mutex);
|
mutex_init(&mutex);
|
||||||
|
|
||||||
thread_create(stack,
|
thread_create(stack,
|
||||||
KERNEL_CONF_STACKSIZE_MAIN,
|
sizeof(stack),
|
||||||
PRIORITY_MAIN - 1,
|
PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST,
|
CREATE_WOUT_YIELD | CREATE_STACKTEST,
|
||||||
second_thread,
|
second_thread,
|
||||||
|
|||||||
@ -142,7 +142,10 @@ int main(void)
|
|||||||
|
|
||||||
#ifndef SENDER
|
#ifndef SENDER
|
||||||
printf("\n\tmain(): starting radio thread\n");
|
printf("\n\tmain(): starting radio thread\n");
|
||||||
radio_pid = thread_create(radio_stack_buffer, RADIO_STACK_SIZE, PRIORITY_MAIN - 2, CREATE_STACKTEST, radio, "radio");
|
radio_pid = thread_create(
|
||||||
|
radio_stack_buffer, sizeof(radio_stack_buffer),
|
||||||
|
PRIORITY_MAIN - 2, CREATE_STACKTEST,
|
||||||
|
radio, "radio");
|
||||||
transceiver_register(TRANSCEIVER_NATIVE, radio_pid);
|
transceiver_register(TRANSCEIVER_NATIVE, radio_pid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ static void test1(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
puts("first: thread create");
|
puts("first: thread create");
|
||||||
int pid = thread_create(test1_thread_stack, KERNEL_CONF_STACKSIZE_MAIN,
|
int pid = thread_create(test1_thread_stack, sizeof(test1_thread_stack),
|
||||||
PRIORITY_MAIN - 1, CREATE_STACKTEST | CREATE_WOUT_YIELD,
|
PRIORITY_MAIN - 1, CREATE_STACKTEST | CREATE_WOUT_YIELD,
|
||||||
test1_second_thread, "second");
|
test1_second_thread, "second");
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ void test2(void)
|
|||||||
snprintf(names[i], sizeof(names[i]), "priority %d", priority);
|
snprintf(names[i], sizeof(names[i]), "priority %d", priority);
|
||||||
printf("first: thread create: %d\n", priority);
|
printf("first: thread create: %d\n", priority);
|
||||||
int pid = thread_create(test2_thread_stack[i],
|
int pid = thread_create(test2_thread_stack[i],
|
||||||
KERNEL_CONF_STACKSIZE_MAIN, priority, CREATE_STACKTEST,
|
sizeof(test2_thread_stack[i]), priority, CREATE_STACKTEST,
|
||||||
priority_sema_thread, names[i]);
|
priority_sema_thread, names[i]);
|
||||||
|
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ int main(void)
|
|||||||
pthread_cond_init(&cv, NULL);
|
pthread_cond_init(&cv, NULL);
|
||||||
|
|
||||||
int pid = thread_create(stack,
|
int pid = thread_create(stack,
|
||||||
KERNEL_CONF_STACKSIZE_MAIN,
|
sizeof(stack),
|
||||||
PRIORITY_MAIN - 1,
|
PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST,
|
CREATE_WOUT_YIELD | CREATE_STACKTEST,
|
||||||
second_thread,
|
second_thread,
|
||||||
|
|||||||
@ -34,7 +34,10 @@ void second_thread(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
(void) thread_create(t2_stack, STACK_SIZE, PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST, second_thread, "nr2");
|
(void) thread_create(
|
||||||
|
t2_stack, sizeof(t2_stack),
|
||||||
|
PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
|
||||||
|
second_thread, "nr2");
|
||||||
puts("first thread\n");
|
puts("first thread\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,7 @@ int main(void)
|
|||||||
|
|
||||||
for (int i = 0; i < PROBLEM; ++i) {
|
for (int i = 0; i < PROBLEM; ++i) {
|
||||||
printf("Creating thread with arg %d\n", (i + 1));
|
printf("Creating thread with arg %d\n", (i + 1));
|
||||||
ths[i] = thread_create(stacks[i], STACK_SIZE, PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST, run, "thread");
|
ths[i] = thread_create(stacks[i], sizeof(stacks[i]), PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST, run, "thread");
|
||||||
|
|
||||||
if (ths[i] < 0) {
|
if (ths[i] < 0) {
|
||||||
printf("[!!!] Creating thread failed with %d\n", err);
|
printf("[!!!] Creating thread failed with %d\n", err);
|
||||||
|
|||||||
@ -75,11 +75,11 @@ void thread3(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
|
||||||
p2 = thread_create(t2_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p2 = thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread2, "nr2");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread2, "nr2");
|
||||||
p3 = thread_create(t3_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p3 = thread_create(t3_stack, sizeof(t3_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread3, "nr3");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread3, "nr3");
|
||||||
puts("THREADS CREATED\n");
|
puts("THREADS CREATED\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -55,7 +55,7 @@ int main(void)
|
|||||||
msg_t msg_q[1];
|
msg_t msg_q[1];
|
||||||
msg_init_queue(msg_q, 1);
|
msg_init_queue(msg_q, 1);
|
||||||
|
|
||||||
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
|
||||||
|
|
||||||
/* step 3: receive a msg */
|
/* step 3: receive a msg */
|
||||||
|
|||||||
@ -52,7 +52,7 @@ int main(void)
|
|||||||
msg_t msg;
|
msg_t msg;
|
||||||
p_main = sched_active_pid;
|
p_main = sched_active_pid;
|
||||||
|
|
||||||
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
|
||||||
|
|
||||||
/* step 3: receive a msg */
|
/* step 3: receive a msg */
|
||||||
|
|||||||
@ -50,11 +50,11 @@ int main(void)
|
|||||||
{
|
{
|
||||||
msg_t msg;
|
msg_t msg;
|
||||||
|
|
||||||
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr1");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr1");
|
||||||
p2 = thread_create(t2_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p2 = thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr2");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr2");
|
||||||
p3 = thread_create(t3_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
|
p3 = thread_create(t3_stack, sizeof(t3_stack), PRIORITY_MAIN - 1,
|
||||||
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr3");
|
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr3");
|
||||||
|
|
||||||
puts("THREADS CREATED\n");
|
puts("THREADS CREATED\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user