~ubuntu-branches/ubuntu/trusty/sblim-sfcb/trusty-proposed

« back to all changes in this revision

Viewing changes to classProviderGz.c

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2009-06-08 12:04:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090608120449-byfplk09rqz8rtg6
Tags: 1.3.3-0ubuntu1
* New upstream release.
* debian/rules: Removed rpath hacks, SFCB default build handles that now.
* Removed 1934753-remove-assignment.diff, now upstream.
* Refreshed patch cim-schema-location.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
} NameSpaces;
125
125
 
126
126
static UtilHashTable *nsHt=NULL;
 
127
static pthread_once_t nsHt_once = PTHREAD_ONCE_INIT;
127
128
static int nsBaseLen;
128
129
 
129
130
static void buildInheritanceTable(ClassRegister * cr)
402
403
      free(buf);
403
404
      free(cc);
404
405
   }
405
 
 
 
406
 
406
407
   if (cr->vr) {
407
408
      mlogf(M_INFO,M_SHOW,"--- Caching ClassProvider for %s (%d.%d-%d) using %ld bytes\n", 
408
409
          fin, cr->vr->version, cr->vr->level, cr->vr->objImplLevel, total);
476
477
   return gatherNameSpaces(dn,NULL,1);   
477
478
}    
478
479
 
 
480
static void nsHt_init()
 
481
{
 
482
  nsHt=buildClassRegisters();
 
483
}
 
484
 
479
485
 
480
486
static ClassRegister *getNsReg(const CMPIObjectPath *ref, int *rc)
481
487
{
483
489
   CMPIString *nsi=CMGetNameSpace(ref,NULL);
484
490
   ClassRegister *cReg;
485
491
   *rc=0;
486
 
   
487
 
   if (nsHt==NULL) nsHt=buildClassRegisters();
488
 
   
 
492
 
 
493
   pthread_once(&nsHt_once, nsHt_init);
 
494
 
 
495
   if (nsHt==NULL) {
 
496
     mlogf(M_ERROR,M_SHOW,"--- ClassProvider: namespace hash table not initialized\n");
 
497
     *rc = 1;
 
498
     return NULL;
 
499
   }
 
500
 
489
501
   if (nsi && nsi->hdl) {
490
502
      ns=(char*)nsi->hdl;
491
503
      if (strcasecmp(ns,"root/pg_interop")==0)
775
787
{
776
788
   CMPIStatus st = { CMPI_RC_OK, NULL };
777
789
   CMPIString *cn = CMGetClassName(ref, NULL);
778
 
   CMPIConstClass *cl;
 
790
   CMPIConstClass *cl, *clLocal;
779
791
   ClassRegister *cReg;
780
792
   int rc;
781
793
   void *cid;
791
803
 
792
804
   cReg->ft->wLock(cReg);
793
805
   
794
 
   cl = getClass(cReg, (char *) cn->hdl,&cid);
795
 
   if (cl) {
 
806
   /* Make a cloned copy of the cached results to prevent
 
807
      thread interference. */
 
808
   clLocal = getClass(cReg, (char *) cn->hdl,&cid);
 
809
 
 
810
   if (clLocal) {
796
811
      _SFCB_TRACE(1,("--- Class found"));
 
812
      cl = clLocal->ft->clone(clLocal, NULL);
 
813
      memLinkInstance((CMPIInstance*)cl);
797
814
      CMReturnInstance(rslt, (CMPIInstance *) cl);
798
815
   } else {
799
816
      _SFCB_TRACE(1,("--- Class not found"));