Esempio n. 1
0
void GenericDeInitialize()

{
Debug("GenericDeInitialize()\n");

CloseWmi();
CloseNetwork();
Cf3CloseLog();
CloseAllDB();
}
Esempio n. 2
0
int main(int argc, char **argv)
{
    if (argc != 2)
    {
        fprintf(stderr, "Usage: db_load <num_threads>\n");
        exit(1);
    }

    unlink("/tmp/cf_classes.qdbm");
    unlink("/tmp/cf_classes.tcdb");

    int numthreads = atoi(argv[1]);

    assert(numthreads < MAX_THREADS);

    srand(time(NULL));

    pthread_t tids[MAX_THREADS];
    pthread_attr_t attr;

    pthread_attr_init(&attr);
    pthread_attr_setstacksize(&attr, 65536);
    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);

    for (int i = 0; i < numthreads; ++i)
    {
        int ret = pthread_create(&(tids[i]), &attr, &contend, NULL);

        if (ret != 0)
        {
            fprintf(stderr, "Unable to create thread: %s\n", strerror(ret));
        }
    }

    pthread_attr_destroy(&attr);

    int retvals[MAX_THREADS];

    int failures = WriteReturnValues(retvals, tids, numthreads);

    CloseAllDB();

    exit(failures);
}
CExportDB::~CExportDB( )
{
	CloseAllDB( );
}