| 
									
										
										
											
												Merged 43316, 43317, 43318, 43733, 43782, 43873, 43888, 43916, 43950, 44055, 44056, 44058, 44073, 44074, 44132, 44137, 44138, 44140, 44344 from trunk to release
[SVN r47339]
											
										 
											2008-07-12 09:55:08 +00:00
										 |  |  | //
 | 
					
						
							|  |  |  | // spinlock_test.cpp
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Copyright 2008 Peter Dimov
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Distributed under the Boost Software License, Version 1.0.
 | 
					
						
							|  |  |  | // See accompanying file LICENSE_1_0.txt or copy at
 | 
					
						
							|  |  |  | // http://www.boost.org/LICENSE_1_0.txt)
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-02 16:22:16 +00:00
										 |  |  | #include <boost/smart_ptr/detail/spinlock.hpp>
 | 
					
						
							| 
									
										
										
											
												Merged 43316, 43317, 43318, 43733, 43782, 43873, 43888, 43916, 43950, 44055, 44056, 44058, 44073, 44074, 44132, 44137, 44138, 44140, 44344 from trunk to release
[SVN r47339]
											
										 
											2008-07-12 09:55:08 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Sanity check only
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static boost::detail::spinlock sp = BOOST_DETAIL_SPINLOCK_INIT; | 
					
						
							|  |  |  | static boost::detail::spinlock sp2 = BOOST_DETAIL_SPINLOCK_INIT; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int main() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     sp.lock(); | 
					
						
							|  |  |  |     sp2.lock(); | 
					
						
							|  |  |  |     sp.unlock(); | 
					
						
							|  |  |  |     sp2.unlock(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         boost::detail::spinlock::scoped_lock lock( sp ); | 
					
						
							|  |  |  |         boost::detail::spinlock::scoped_lock lock2( sp2 ); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return 0; | 
					
						
							|  |  |  | } |