mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
update st research.
This commit is contained in:
parent
85c2398e78
commit
388305f44c
1 changed files with 31 additions and 0 deletions
|
@ -1,7 +1,38 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "public.h"
|
#include "public.h"
|
||||||
|
|
||||||
|
#define srs_trace(msg, ...) printf(msg, ##__VA_ARGS__);printf("\n")
|
||||||
|
|
||||||
|
void* pfn(void* arg)
|
||||||
|
{
|
||||||
|
st_sleep(1);
|
||||||
|
srs_trace("st thread is ok");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
if (st_set_eventsys(ST_EVENTSYS_ALT) < 0) {
|
||||||
|
srs_trace("st_set_eventsys failed");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (st_init() < 0) {
|
||||||
|
srs_trace("st_init failed");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!st_thread_create(pfn, NULL, 0, 0)) {
|
||||||
|
srs_trace("st_thread_create failed");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
srs_trace("st is ok");
|
||||||
|
|
||||||
|
st_thread_exit(NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue