~ubuntu-branches/ubuntu/oneiric/ecasound2.2/oneiric

« back to all changes in this revision

Viewing changes to kvutils/kvu_locks.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2008-03-23 21:42:49 UTC
  • mfrom: (3.1.6 hardy)
  • Revision ID: james.westby@ubuntu.com-20080323214249-evlfv3y1o8q747la
Tags: 2.4.6.1-2
* Bug fix: "FTBFS with GCC 4.3: missing #includes", thanks to Martin
  Michlmayr (Closes: #454890).
- 13_gcc4: updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// ------------------------------------------------------------------------
2
2
// kvu_locks.cpp: Various lock related helper functions.
3
 
// Copyright (C) 2000-2002 Kai Vehmanen
 
3
// Copyright (C) 2000-2002,2006 Kai Vehmanen
4
4
//
5
5
// This program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
23
23
#include "kvu_dbc.h"
24
24
#include "kvu_locks.h"
25
25
 
26
 
/* NOTE: This implementation doesn't really guarantee correct
27
 
 *       operation at the moment as I wanted to avoid 
28
 
 *       maintaining primitives for dozens of different 
29
 
 *       platforms.
30
 
 *
31
 
 *       The primary reason for using this class is to 
32
 
 *       mark all code segments where atomic access 
33
 
 *       is required.
 
26
/* NOTE: This implementation is currenly a dummy one. The primary 
 
27
 *       reason to use ATOMIC_OINT() is to mark all code segments 
 
28
 *       where atomic read/write access is required.
34
29
 *
35
30
 * Tested platforms:
36
31
 *   - IA32 single- and multi-processor cases
37
32
 *
38
 
 * Platforms that should work according to specs:
 
33
 * Platforms that should be atomic w.r.t. read/writes:
39
34
 *   - Alpha
40
 
 *   - ARM
 
35
 *   - ARM-v4 (ARM9) and older
41
36
 *   - IA64
 
37
 *   - MIPS
42
38
 *   - PowerPC
 
39
 *   - SH
 
40
 *   - S390
 
41
 *   - SPARC64
 
42
 *   - X86-64
43
43
 * 
44
 
 * Platforms that do _NOT_ work:
45
 
 *   - multi-processor SPARC
46
 
 *   - IBM's S390
 
44
 * Platforms that where writes from multiple threads do _NOT_ work:
 
45
 *   - ARM-v6 (ARM11) and up 
 
46
 *   - SPARC32
 
47
 *
 
48
 * References: 
 
49
 *   - architecture manuals
 
50
 *   - Linux kernel and glibc sources
47
51
 */
48
52
 
49
53
ATOMIC_INTEGER::ATOMIC_INTEGER(int value)
57
61
 
58
62
int ATOMIC_INTEGER::get(void) const
59
63
{
60
 
  return(value_rep);
 
64
  return value_rep;
61
65
}
62
66
 
63
67
void ATOMIC_INTEGER::set(int value)