~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to storage/ndb/src/kernel/vm/LongSignalImpl.hpp

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2008 Sun Microsystems, Inc.
 
2
    All rights reserved. Use is subject to license terms.
 
3
 
 
4
   This program is free software; you can redistribute it and/or modify
 
5
   it under the terms of the GNU General Public License as published by
 
6
   the Free Software Foundation; version 2 of the License.
 
7
 
 
8
   This program is distributed in the hope that it will be useful,
 
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
   GNU General Public License for more details.
 
12
 
 
13
   You should have received a copy of the GNU General Public License
 
14
   along with this program; if not, write to the Free Software
 
15
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
 
16
 
 
17
#ifndef NDB_LS_IMPL_HPP
 
18
#define NDB_LS_IMPL_HPP
 
19
 
 
20
#include "LongSignal.hpp"
 
21
 
 
22
#ifdef NDBD_MULTITHREADED
 
23
#include "mt.hpp"
 
24
#define SPC_ARG SectionSegmentPool::Cache& cache,
 
25
#define SPC_SEIZE_ARG f_section_lock, cache,
 
26
#define SPC_CACHE_ARG cache,
 
27
static
 
28
SectionSegmentPool::LockFun
 
29
f_section_lock =
 
30
{
 
31
  mt_section_lock,
 
32
  mt_section_unlock
 
33
};
 
34
#else
 
35
#define SPC_ARG
 
36
#define SPC_SEIZE_ARG
 
37
#define SPC_CACHE_ARG
 
38
#endif
 
39
 
 
40
/* Calculate number of segments to release based on section size
 
41
 * Always release one segment, even if size is zero
 
42
 */
 
43
#define relSz(x) ((x == 0)? 1 : ((x + SectionSegment::DataLength - 1) / SectionSegment::DataLength))
 
44
 
 
45
bool import(SPC_ARG Ptr<SectionSegment> & first, const Uint32 * src, Uint32 len);
 
46
 
 
47
/* appendToSection : If firstSegmentIVal == RNIL, import */
 
48
bool appendToSection(SPC_ARG Uint32& firstSegmentIVal, const Uint32* src, Uint32 len);
 
49
/* dupSection : Create new section as copy of src section */
 
50
bool dupSection(SPC_ARG Uint32& copyFirstIVal, Uint32 srcFirstIVal);
 
51
/* writeToSection : Overwrite section from offset with data.  */
 
52
bool writeToSection(Uint32 firstSegmentIVal, Uint32 offset, const Uint32* src, Uint32 len);
 
53
 
 
54
void release(SPC_ARG SegmentedSectionPtr & ptr);
 
55
void releaseSection(SPC_ARG Uint32 firstSegmentIVal);
 
56
 
 
57
#endif