mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Further reworking the thread API.
This commit is contained in:
parent
f7a6407ab1
commit
f6b883bafc
7 changed files with 36 additions and 13 deletions
|
@ -289,6 +289,11 @@ inline size_t pad_size(size_t size)
|
|||
|
||||
#define padded_sizeof(x) (pad_size(sizeof(x)))
|
||||
|
||||
// Like write() but handles interrupted system calls by restarting. Returns
|
||||
// true if the write was successful, otherwise sets errno. This function is
|
||||
// thread-safe as long as no two threads write to the same descriptor.
|
||||
extern bool safe_write(int fd, const char* data, int len);
|
||||
|
||||
extern void out_of_memory(const char* where);
|
||||
|
||||
inline void* safe_realloc(void* ptr, size_t size)
|
||||
|
@ -338,4 +343,5 @@ inline int safe_vsnprintf(char* str, size_t size, const char* format, va_list al
|
|||
// handed out by malloc.
|
||||
extern void get_memory_usage(unsigned int* total,
|
||||
unsigned int* malloced);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue