Skip to content

Commit e8046aa

Browse files
committed
plugins REFACTOR minor improvements
1 parent 3eba843 commit e8046aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/plugins.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ plugins_iter(const struct ly_ctx *ctx, enum LYPLG type, uint32_t *index)
211211
* @return Found plugin record or NULL if not found.
212212
*/
213213
static void *
214-
lyplg_record_find(const struct ly_ctx *ctx, enum LYPLG type, const char *module, const char *revision, const char *name, uint32_t *record_idx)
214+
lyplg_record_find(const struct ly_ctx *ctx, enum LYPLG type, const char *module, const char *revision, const char *name,
215+
uint32_t *record_idx)
215216
{
216217
uint32_t i = 0;
217218
struct lyplg_record *item;
@@ -562,8 +563,9 @@ lyplg_init(ly_bool builtin_type_plugins_only, ly_bool static_plugins_only)
562563
{
563564
LY_ERR ret;
564565

565-
pthread_mutex_lock(&plugins_guard);
566566
/* let only the first context to initiate plugins, but let others wait for finishing the initiation */
567+
pthread_mutex_lock(&plugins_guard);
568+
567569
if (context_refcount++) {
568570
/* already initiated */
569571
pthread_mutex_unlock(&plugins_guard);

0 commit comments

Comments
 (0)