AgsConcurrentTree

AgsConcurrentTree — thread-safe locking of tree

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── AgsConcurrentTree

Includes

#include <ags/object/ags_concurrent_tree.h>

Description

The AgsConcurrentTree interface provides essential locks to process tree with parallelism.

Functions

ags_concurrent_tree_set_parent_locked ()

void
ags_concurrent_tree_set_parent_locked (AgsConcurrentTree *concurrent_tree,
                                       gboolean parent_locked);

Set context owns parent lock

Parameters

concurrent_tree

an AgsConcurrentTree

 

parent_locked

TRUE means the parent is locked

 

Since: 1.0.0


ags_concurrent_tree_get_parent_locked ()

gboolean
ags_concurrent_tree_get_parent_locked (AgsConcurrentTree *concurrent_tree);

If context owns parent lock

Parameters

concurrent_tree

an AgsConcurrentTree

 

Returns

the TRUE if parent locked, else FALSE

Since: 1.0.0


ags_concurrent_tree_get_lock ()

pthread_mutex_t *
ags_concurrent_tree_get_lock (AgsConcurrentTree *concurrent_tree);

Get tree node's lock.

Parameters

concurrent_tree

an AgsConcurrentTree

 

Returns

the pthread_mutex_t

Since: 1.0.0


ags_concurrent_tree_get_parent_lock ()

pthread_mutex_t *
ags_concurrent_tree_get_parent_lock (AgsConcurrentTree *concurrent_tree);

Get tree node's parent lock.

Parameters

concurrent_tree

an AgsConcurrentTree

 

Returns

the pthread_mutex_t

Since: 1.0.0


ags_concurrent_tree_lock_context ()

gboolean
ags_concurrent_tree_lock_context (AgsConcurrentTree *concurrent_tree);

Locks the context of concurrent_tree and blocks until success.

Parameters

concurrent_tree

the AgsConcurrentTree

 

Returns

TRUE if parent locked

Since: 1.0.0


ags_concurrent_tree_unlock_context ()

void
ags_concurrent_tree_unlock_context (AgsConcurrentTree *concurrent_tree);

Unlocks the context of concurrent_tree .

Parameters

concurrent_tree

the AgsConcurrentTree

 

Since: 1.0.0


AGS_CONCURRENT_TREE()

#define AGS_CONCURRENT_TREE(obj)                    (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_CONCURRENT_TREE, AgsConcurrentTree))

AGS_CONCURRENT_TREE_GET_INTERFACE()

#define AGS_CONCURRENT_TREE_GET_INTERFACE(obj)      (G_TYPE_INSTANCE_GET_INTERFACE((obj), AGS_TYPE_CONCURRENT_TREE, AgsConcurrentTreeInterface))

AGS_CONCURRENT_TREE_INTERFACE()

#define AGS_CONCURRENT_TREE_INTERFACE(vtable)       (G_TYPE_CHECK_CLASS_CAST((vtable), AGS_TYPE_CONCURRENT_TREE, AgsConcurrentTreeInterface))

AGS_IS_CONCURRENT_TREE()

#define AGS_IS_CONCURRENT_TREE(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_CONCURRENT_TREE))

AGS_IS_CONCURRENT_TREE_INTERFACE()

#define AGS_IS_CONCURRENT_TREE_INTERFACE(vtable)    (G_TYPE_CHECK_CLASS_TYPE((vtable), AGS_TYPE_CONCURRENT_TREE))

ags_concurrent_tree_get_type ()

GType
ags_concurrent_tree_get_type ();

Types and Values

AGS_TYPE_CONCURRENT_TREE

#define AGS_TYPE_CONCURRENT_TREE                    (ags_concurrent_tree_get_type())

AgsConcurrentTree

typedef struct _AgsConcurrentTree AgsConcurrentTree;

struct AgsConcurrentTreeInterface

struct AgsConcurrentTreeInterface {
  GTypeInterface ginterface;

  void (*set_parent_locked)(AgsConcurrentTree *concurrent_tree,
			    gboolean parent_locked);
  gboolean (*get_parent_locked)(AgsConcurrentTree *concurrent_tree);
  
  pthread_mutex_t* (*get_lock)(AgsConcurrentTree *concurrent_tree);
  pthread_mutex_t* (*get_parent_lock)(AgsConcurrentTree *concurrent_tree);
};