Changeset 5312:27ec111dc8c5 in roaraudio for roard/plugins.c


Ignore:
Timestamp:
11/30/11 01:05:41 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support for seperate contextes for roardl/plugins. Currently incudes error state and a global per handle data segment. This does not work for statically linked librarys (yet). support for per-context notify core needs to be added/completed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/plugins.c

    r5275 r5312  
    5757 int i; 
    5858 
    59  if ( plugin->sched != NULL ) 
    60   if ( plugin->sched->free != NULL ) 
     59 if ( plugin->sched != NULL ) { 
     60  if ( plugin->sched->free != NULL ) { 
     61   roar_dl_context_restore(plugin->lhandle); 
    6162   plugin->sched->free(); 
     63   roar_dl_context_store(plugin->lhandle); 
     64  } 
     65 } 
    6266 
    6367 for (i = 0; i < MAX_PROTOS; i++) { 
     
    8791   } 
    8892 
    89    if ( g_plugins[i].sched != NULL ) 
    90     if ( g_plugins[i].sched->init != NULL ) 
     93   if ( g_plugins[i].sched != NULL ) { 
     94    if ( g_plugins[i].sched->init != NULL ) { 
     95     roar_dl_context_restore(g_plugins[i].lhandle); 
    9196     g_plugins[i].sched->init(); 
     97     roar_dl_context_store(g_plugins[i].lhandle); 
     98    } 
     99   } 
    92100 
    93101   _pp = NULL; 
     
    114122 int i; 
    115123 
    116  for (i = 0; i < MAX_PLUGINS; i++) 
    117   if ( g_plugins[i].lhandle != NULL ) 
    118    if ( g_plugins[i].sched != NULL ) 
    119     if ( g_plugins[i].sched->update != NULL ) 
     124 for (i = 0; i < MAX_PLUGINS; i++) { 
     125  if ( g_plugins[i].lhandle != NULL ) { 
     126   if ( g_plugins[i].sched != NULL ) { 
     127    if ( g_plugins[i].sched->update != NULL ) { 
     128     roar_dl_context_restore(g_plugins[i].lhandle); 
    120129     if ( g_plugins[i].sched->update() == -1 ) 
    121130      ret = -1; 
     131     roar_dl_context_store(g_plugins[i].lhandle); 
     132    } 
     133   } 
     134  } 
     135 } 
    122136 
    123137 return ret; 
     
    178192 } 
    179193 
    180  return clients_register_proto(proto); 
     194 return clients_register_proto(proto, _pp->lhandle); 
    181195} 
    182196 
Note: See TracChangeset for help on using the changeset viewer.