~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/test/mutex003.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# See the file LICENSE for redistribution information.
2
 
#
3
 
# Copyright (c) 1996-2002
4
 
#       Sleepycat Software.  All rights reserved.
5
 
#
6
 
# $Id$
7
 
#
8
 
 
9
 
# TEST  mutex003
10
 
# TEST  Generate a bunch of parallel testers that try to randomly obtain locks.
11
 
proc mutex003 { } {
12
 
        source ./include.tcl
13
 
 
14
 
        set nmutex 20
15
 
        set iter 500
16
 
        set procs 5
17
 
        set mdegree 3
18
 
        set wait 2
19
 
        puts "Mutex003: Multi-process random mutex test"
20
 
 
21
 
        env_cleanup $testdir
22
 
 
23
 
        puts "\tMutex003.a: Create environment"
24
 
        # Now open the region we'll use for multiprocess testing.
25
 
        set env [berkdb_env -create -mode 0644 -lock -home $testdir]
26
 
        error_check_good env_open [is_valid_env $env] TRUE
27
 
 
28
 
        set mutex [$env mutex 0644 $nmutex]
29
 
        error_check_good mutex_init [is_valid_mutex $mutex $env] TRUE
30
 
 
31
 
        error_check_good mutex_close [$mutex close] 0
32
 
 
33
 
        # Now spawn off processes
34
 
        puts "\tMutex003.b: Create $procs processes"
35
 
        set pidlist {}
36
 
        for { set i 0 } {$i < $procs} {incr i} {
37
 
                puts "$tclsh_path\
38
 
                    $test_path/mutexscript.tcl $testdir\
39
 
                    $iter $nmutex $wait $mdegree > $testdir/$i.mutexout &"
40
 
                set p [exec $tclsh_path $test_path/wrap.tcl \
41
 
                    mutexscript.tcl $testdir/$i.mutexout $testdir\
42
 
                    $iter $nmutex $wait $mdegree &]
43
 
                lappend pidlist $p
44
 
        }
45
 
        puts "\tMutex003.c: $procs independent processes now running"
46
 
        watch_procs $pidlist
47
 
        error_check_good env_close [$env close] 0
48
 
        # Remove output files
49
 
        for { set i 0 } {$i < $procs} {incr i} {
50
 
                fileremove -f $testdir/$i.mutexout
51
 
        }
52
 
}