Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions | Variables
20.temp.buffer.mt.cpp File Reference
#include <memory>
#include <utility>
#include <cassert>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <rw_driver.h>
#include <rw_thread.h>
Include dependency graph for 20.temp.buffer.mt.cpp:

Go to the source code of this file.

Data Structures

struct  thr_args< intT >
 

Macros

#define MAX_THREADS   0
 

Functions

template<class T >
std::pair< T *, std::ptrdiff_t > test_get_buffer (thr_args *args, T *, unsigned nobjs)
 
template<class T >
void test_return_buffer (thr_args *args, std::pair< T *, std::ptrdiff_t > &buf)
 
void * thr_func (void *arg)
 
int main (int argc, char *argv[])
 

Variables

unsigned rw_opt_nthreads = 4 <= MAX_THREADS ? 4 : MAX_THREADS
 
unsigned rw_opt_nloops = 1024 * 1024
 

Macro Definition Documentation

◆ MAX_THREADS

#define MAX_THREADS   0

20.temp.buffer.mt.cpp - test exercising the thread safety of std::get_temporary_buffer() and std::return_temporary_buffer()

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2005-2008 Rogue Wave Software, Inc.

Definition at line 45 of file 20.temp.buffer.mt.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 240 of file 20.temp.buffer.mt.cpp.

◆ test_get_buffer()

template<class T >
std::pair< T *, std::ptrdiff_t > test_get_buffer ( thr_args *  args,
T *  ,
unsigned  nobjs 
)

Definition at line 66 of file 20.temp.buffer.mt.cpp.

◆ test_return_buffer()

template<class T >
void test_return_buffer ( thr_args *  args,
std::pair< T *, std::ptrdiff_t > &  buf 
)

Definition at line 93 of file 20.temp.buffer.mt.cpp.

◆ thr_func()

void * thr_func ( void *  arg)

Definition at line 125 of file 20.temp.buffer.mt.cpp.

Variable Documentation

◆ rw_opt_nloops

unsigned rw_opt_nloops = 1024 * 1024

Definition at line 51 of file 20.temp.buffer.mt.cpp.

◆ rw_opt_nthreads

unsigned rw_opt_nthreads = 4 <= MAX_THREADS ? 4 : MAX_THREADS

Definition at line 50 of file 20.temp.buffer.mt.cpp.