This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Try chunked stream</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="progress_container" style="width: 123px; height: 20px; background-color: white; border: solid black 1px"> | |
<div id="progress_bar" style="width: 0px; height: 18px; background-color: white; border: solid blue 1px; background-color: blue"> | |
</div> | |
<br style="clear:both"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_cmake_property(var_names VARIABLES) | |
foreach (var ${var_names}) | |
message(STATUS "${var}=${${var}}") | |
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct Foo Foo; | |
Foo *bar; // this is ok | |
void bartest() | |
{ | |
bar->a = 2; // this is NOT ok, struct Foo is not defined | |
} | |
// Note, no typedef here, just defining struct Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
class ProducerConsumer | |
{ | |
thread_mutex queue_lock; | |
thread_condition_variable queue_not_empty; | |
thread_condition_variable queue_not_full; | |
typedef std::deque<T> Queue; | |
Queue queue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
project(producerconsumer) | |
set(SRC | |
main.cpp | |
util_pcqueue.h | |
) | |
if(CMAKE_COMPILER_IS_GNUCXX ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linking CXX executable test_pc_std | |
/usr/bin/cmake -E cmake_link_script CMakeFiles/test_pc_std.dir/link.txt --verbose=1 | |
/usr/bin/c++ -std=c++11 -pthread CMakeFiles/test_pc_std.dir/main.cpp.o CMakeFiles/test_pc_std.dir/dummy.cpp.o -o test_pc_std -rdynamic | |
CMakeFiles/test_pc_std.dir/main.cpp.o: In function `main': | |
main.cpp:(.text+0xe7): undefined reference to `boost::thread::join()' | |
main.cpp:(.text+0xf6): undefined reference to `boost::thread::join()' | |
main.cpp:(.text+0x10a): undefined reference to `boost::thread::~thread()' | |
main.cpp:(.text+0x119): undefined reference to `boost::thread::~thread()' | |
main.cpp:(.text+0x157): undefined reference to `boost::thread::~thread()' | |
main.cpp:(.text+0x16b): undefined reference to `boost::thread::~thread()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doug@doug-MS-7666 ~/code/producerconsumer/build $ cmake ../producerconsumer | |
-- Boost version: 1.49.0 | |
-- Found the following Boost libraries: | |
-- thread | |
-- boost defines: | |
-- boost include dirs: /usr/include | |
-- boost library dirs: /usr/lib | |
-- boost libraries: /usr/lib/libboost_thread-mt.so;pthread | |
-- Configuring done | |
-- Generating done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef WITH_BOOST | |
#include <boost/thread.hpp> | |
#include <boost/bind.hpp> | |
typedef boost::thread thread; | |
typedef boost::mutex thread_mutex; | |
typedef boost::mutex::scoped_lock thread_scoped_lock; | |
typedef boost::condition_variable thread_condition_variable; | |
#define function_bind boost::bind | |
#define sleep_ms(ms) boost::this_thread::sleep_for(boost::chrono::milliseconds(ms)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef WITH_BOOST | |
#include <boost/thread.hpp> | |
#include <boost/bind.hpp> | |
typedef boost::thread thread; | |
typedef boost::mutex thread_mutex; | |
typedef boost::mutex::scoped_lock thread_scoped_lock; | |
typedef boost::condition_variable thread_condition_variable; | |
#define function_bind boost::bind | |
#define sleep_ms(ms) boost::this_thread::sleep_for(boost::chrono::milliseconds(ms)) | |
#elif __cplusplus >= 201103L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "util_pcqueue.h" | |
#ifdef WITH_BOOST | |
#include <boost/atomic.hpp> | |
#define Atomic boost | |
#elif __cplusplus >= 201103L | |
#include <atomic> | |
#define Atomic std |
OlderNewer