We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when using librdkafka, use pthread to create a thread will be failed.
#include <pthread.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <librdkafka/rdkafka.h> #include <librdkafka/rdkafkacpp.h> static void* msec_thread(void*) { return nullptr; } static void slack_init() { int rc; pthread_attr_t attr; pthread_t thr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 16 * 1024); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); rc = pthread_create(&thr, &attr, msec_thread, NULL); pthread_attr_destroy(&attr); printf("rc:%d\n", rc); } int main(int argc, char **argv) { slack_init(); RdKafka::Conf *conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); delete conf; return 0; }
using above code, it cannot create the thread, and print rc:22, but if I comment the code about rdkafka, it will print rc:0.
librdkafka version: Operating system: ubuntu22.04
v2.3.0
N/A
ubuntu 22.04
debug=..
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
when using librdkafka, use pthread to create a thread will be failed.
How to reproduce
using above code, it cannot create the thread, and print rc:22,
but if I comment the code about rdkafka, it will print rc:0.
Checklist
librdkafka version:
Operating system: ubuntu22.04
v2.3.0
N/A
ubuntu 22.04
debug=..
as necessary) from librdkafkaThe text was updated successfully, but these errors were encountered: