Back to index

nordugrid-arc-nox  1.1.0~rc6
Classes | Functions
test.cpp File Reference
#include <string>
#include <iostream>
#include <unistd.h>
#include <glibmm.h>
#include <db_cxx.h>
#include <arc/Thread.h>

Go to the source code of this file.

Classes

class  TestDB
class  Writer
class  Reader

Functions

static void writer (void *data)
static void reader (void *data)
int main (void)

Function Documentation

int main ( void  )

Definition at line 174 of file test.cpp.

{
    TestDB db;
    Writer w1(db);
    Writer w2(db);
    Reader r1(db);
    Reader r2(db);
    sleep(3000);
    return 0;
}
static void reader ( void *  data) [static]

Definition at line 158 of file test.cpp.

{
    Reader *r = (Reader *)data;
    Glib::Rand rnd;
    for (;;) {
        sleep(rnd.get_int_range(0,3));
        r->do_read();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void writer ( void *  data) [static]

Definition at line 126 of file test.cpp.

{
    Writer *w = (Writer *)data;
    Glib::Rand r;
    for (;;) {
        sleep(r.get_int_range(0,3));
        w->do_write();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function: