Skip to content

Conversation

@cs-moushuai
Copy link

fix #95 #52

volatile int num_threads_working; /* threads currently working */
pthread_mutex_t thcount_lock; /* used for thread count etc */
pthread_cond_t threads_all_idle; /* signal to thpool_wait */
jobqueue jobqueue; /* job queue */
Copy link
Owner

@Pithikos Pithikos Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the main issue with C++? Do you think we could simply use jobqueue_t instead?
Namely I'm a bit hesitant, since renaming to job_queue breaks naming convention with other functions

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think of a simple way to solve it by using extern "C" to avoid problems in C++.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is also a problem with this code style. The struct name should not be consistent with the variable name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using jobqueue_t may be a better choice.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jobqueue_t is not good. _t is reserved for POSIX structures. Normal developer should not define a type end with _t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors when compiling with C++

3 participants