Skip to content
Snippets Groups Projects
Commit eb76f8b7 authored by godzie44's avatar godzie44 Committed by Dmitry Ivanov
Browse files

Part of #37

Add `current_cord_name` function to get a name of the current cord,
add `cord_is_main_dont_create` function.
Add exports for `cord_is_main`, `cord_is_main_dont_create` and
`current_cord_name` functions.

NO_DOC=internal
NO_TEST=internal
NO_CHANGELOG=internal
parent 7ca3ccad
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,8 @@ console_set_output_format
cord_ibuf_drop
cord_ibuf_put
cord_ibuf_take
cord_is_main
cord_is_main_dont_create
cord_slab_cache
crc32_calc
crypto_ERR_error_string
......@@ -213,6 +215,7 @@ csv_feed
csv_iterator_create
csv_next
csv_setopt
current_cord_name
decimal_from_string
decimal_unpack
error_find_field
......
......@@ -2203,6 +2203,20 @@ cord_is_main(void)
return cord() == &main_cord;
}
bool
cord_is_main_dont_create(void)
{
return cord_ptr == &main_cord;
}
const char *
current_cord_name(void)
{
if (cord_ptr == NULL)
return NULL;
return cord_name(cord_ptr);
}
struct slab_cache *
cord_slab_cache(void)
{
......
......@@ -949,10 +949,21 @@ cord_name(struct cord *cord)
return cord->name;
}
/** @return a current cord name. */
API_EXPORT const char *
current_cord_name(void);
/** True if this cord represents the process main thread. */
bool
cord_is_main(void);
/**
* Like `cord_is_main` but without creating a new cord
* if it doesn't exists.
*/
API_EXPORT bool
cord_is_main_dont_create(void);
/**
* Delete the latest garbage fiber which couldn't be deleted somewhy before. Can
* safely rely on the fiber being not the current one. Because if it was added
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment