You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
779 B
35 lines
779 B
6 years ago
|
/*
|
||
6 years ago
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
6 years ago
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
#include <pthread.h>
|
||
|
|
||
|
void dummy() {}
|
||
|
|
||
|
void deref_pointer(int* x) { int y = *x; }
|
||
|
|
||
|
int pthread_create_dummy_ok() {
|
||
|
pthread_t thread;
|
||
|
return pthread_create(&thread, NULL, dummy, NULL);
|
||
|
}
|
||
|
|
||
|
int pthread_create_deref_bad() {
|
||
|
pthread_t thread;
|
||
|
return pthread_create(&thread, NULL, deref_pointer, NULL);
|
||
|
}
|
||
|
|
||
|
int pthread_create_deref_ok() {
|
||
|
pthread_t thread;
|
||
|
int x;
|
||
|
return pthread_create(&thread, NULL, deref_pointer, &x);
|
||
|
}
|
||
|
|
||
|
extern void some_unknown_function(void);
|
||
|
|
||
|
int pthread_unknown_ok() {
|
||
|
pthread_t thread;
|
||
|
return pthread_create(&thread, NULL, some_unknown_function, NULL);
|
||
|
}
|