mirror of
https://gitee.com/Lamdonn/varch.git
synced 2025-12-06 16:56:42 +08:00
33 lines
504 B
C
33 lines
504 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "init.h"
|
|
#include "tool.h"
|
|
#include "valloc.h"
|
|
#include <pthread.h>
|
|
#include <semaphore.h>
|
|
|
|
sem_t s;
|
|
|
|
static void *thread_entry(void *param)
|
|
{
|
|
long thread_id = (long)param;
|
|
|
|
for (;;)
|
|
{
|
|
sem_wait(&s);
|
|
printf("in\r\n");
|
|
}
|
|
return NULL;
|
|
};
|
|
|
|
|
|
static void test(void)
|
|
{
|
|
pthread_t t;
|
|
pthread_create(&t, NULL, thread_entry, NULL);
|
|
printf("pthread\r\n");
|
|
sem_post(&s);
|
|
}
|
|
init_export_app(test);
|