Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
d5b90801
Commit
d5b90801
authored
Sep 03, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch svn r35208
parent
3ee0f366
Hide whitespace changes
Inline
Side-by-side
Showing
67 changed files
with
648 additions
and
79 deletions
+648
-79
object_pool.h
src/base/object_pool.h
+13
-1
object_pool_inl.h
src/base/object_pool_inl.h
+13
-1
resource_pool.h
src/base/resource_pool.h
+13
-1
resource_pool_inl.h
src/base/resource_pool_inl.h
+13
-1
bthread.cpp
src/bthread/bthread.cpp
+13
-1
bthread.h
src/bthread/bthread.h
+13
-1
butex.cpp
src/bthread/butex.cpp
+13
-1
butex.h
src/bthread/butex.h
+13
-1
comlog_initializer.h
src/bthread/comlog_initializer.h
+13
-1
condition_variable.cpp
src/bthread/condition_variable.cpp
+13
-1
condition_variable.h
src/bthread/condition_variable.h
+13
-1
countdown_event.cpp
src/bthread/countdown_event.cpp
+13
-1
countdown_event.h
src/bthread/countdown_event.h
+13
-1
errno.cpp
src/bthread/errno.cpp
+13
-1
errno.h
src/bthread/errno.h
+13
-1
execution_queue.cpp
src/bthread/execution_queue.cpp
+13
-1
execution_queue.h
src/bthread/execution_queue.h
+13
-1
execution_queue_inl.h
src/bthread/execution_queue_inl.h
+13
-1
fd.cpp
src/bthread/fd.cpp
+13
-1
id.cpp
src/bthread/id.cpp
+14
-6
id.h
src/bthread/id.h
+13
-1
interrupt_pthread.cpp
src/bthread/interrupt_pthread.cpp
+13
-1
interrupt_pthread.h
src/bthread/interrupt_pthread.h
+13
-1
key.cpp
src/bthread/key.cpp
+13
-1
list_of_abafree_id.h
src/bthread/list_of_abafree_id.h
+13
-1
log.h
src/bthread/log.h
+13
-1
mutex.cpp
src/bthread/mutex.cpp
+13
-1
mutex.h
src/bthread/mutex.h
+13
-1
parking_lot.h
src/bthread/parking_lot.h
+13
-1
processor.h
src/bthread/processor.h
+13
-1
remote_task_queue.h
src/bthread/remote_task_queue.h
+13
-1
stack.cpp
src/bthread/stack.cpp
+13
-1
stack.h
src/bthread/stack.h
+13
-1
stack_inl.h
src/bthread/stack_inl.h
+13
-1
sys_futex.cpp
src/bthread/sys_futex.cpp
+13
-1
sys_futex.h
src/bthread/sys_futex.h
+13
-1
task_control.cpp
src/bthread/task_control.cpp
+13
-1
task_control.h
src/bthread/task_control.h
+13
-1
task_group.cpp
src/bthread/task_group.cpp
+13
-1
task_group.h
src/bthread/task_group.h
+13
-1
task_group_inl.h
src/bthread/task_group_inl.h
+13
-1
task_meta.h
src/bthread/task_meta.h
+13
-1
timer_thread.cpp
src/bthread/timer_thread.cpp
+13
-1
timer_thread.h
src/bthread/timer_thread.h
+13
-1
types.h
src/bthread/types.h
+13
-1
unstable.h
src/bthread/unstable.h
+13
-1
work_stealing_queue.h
src/bthread/work_stealing_queue.h
+13
-1
bthread_butex_unittest.cpp
test/bthread_butex_unittest.cpp
+1
-1
bthread_cond_unittest.cpp
test/bthread_cond_unittest.cpp
+1
-1
bthread_countdown_event_unittest.cpp
test/bthread_countdown_event_unittest.cpp
+1
-1
bthread_dispatcher_unittest.cpp
test/bthread_dispatcher_unittest.cpp
+1
-1
bthread_execution_queue_unittest.cpp
test/bthread_execution_queue_unittest.cpp
+1
-2
bthread_fd_unittest.cpp
test/bthread_fd_unittest.cpp
+1
-1
bthread_futex_unittest.cpp
test/bthread_futex_unittest.cpp
+1
-1
bthread_id_unittest.cpp
test/bthread_id_unittest.cpp
+15
-8
bthread_key_unittest.cpp
test/bthread_key_unittest.cpp
+1
-1
bthread_list_unittest.cpp
test/bthread_list_unittest.cpp
+1
-1
bthread_mutex_unittest.cpp
test/bthread_mutex_unittest.cpp
+1
-1
bthread_ping_pong_unittest.cpp
test/bthread_ping_pong_unittest.cpp
+1
-1
bthread_rwlock_unittest.cpp
test/bthread_rwlock_unittest.cpp
+1
-1
bthread_setconcurrency_unittest.cpp
test/bthread_setconcurrency_unittest.cpp
+1
-1
bthread_timer_thread_unittest.cpp
test/bthread_timer_thread_unittest.cpp
+1
-1
bthread_unittest.cpp
test/bthread_unittest.cpp
+1
-1
bthread_work_stealing_queue_unittest.cpp
test/bthread_work_stealing_queue_unittest.cpp
+1
-1
object_pool_unittest.cpp
test/object_pool_unittest.cpp
+1
-1
resource_pool_unittest.cpp
test/resource_pool_unittest.cpp
+1
-1
patch_from_svn
tools/patch_from_svn
+3
-0
No files found.
src/base/object_pool.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2011 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
src/base/object_pool_inl.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2011 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
src/base/resource_pool.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2011 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
src/base/resource_pool_inl.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2011 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
src/bthread/bthread.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/bthread.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/butex.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 22 17:30:12 CST 2014
...
...
src/bthread/butex.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 22 17:30:12 CST 2014
...
...
src/bthread/comlog_initializer.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Mon Sep 15 10:51:15 CST 2014
...
...
src/bthread/condition_variable.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014
...
...
src/bthread/condition_variable.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2015 baidu-rpc authors.
//
// Licensed 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.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/12/14 21:26:26
...
...
src/bthread/countdown_event.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2016 baidu-rpc authors.
//
// Licensed 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.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/06/03 13:15:24
...
...
src/bthread/countdown_event.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2016 baidu-rpc authors.
//
// Licensed 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.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/06/03 13:06:40
...
...
src/bthread/errno.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2010 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Wed Jul 30 11:47:19 CST 2014
...
...
src/bthread/errno.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Wed Jul 30 11:47:19 CST 2014
...
...
src/bthread/execution_queue.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2016 baidu-rpc authors.
//
// Licensed 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.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/04/16 18:43:24
...
...
src/bthread/execution_queue.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2015 baidu-rpc authors.
//
// Licensed 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.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/10/23 18:16:16
...
...
src/bthread/execution_queue_inl.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2015 baidu-rpc authors.
//
// Licensed 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.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/10/27 17:39:48
...
...
src/bthread/fd.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Thu Aug 7 18:56:27 CST 2014
...
...
src/bthread/id.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014
...
...
@@ -432,11 +444,7 @@ int bthread_id_lock_and_reset_range_verbose(
meta
->
mutex
.
lock
();
}
else
{
// bthread_id_about_to_destroy was called.
meta
->
mutex
.
unlock
();
// Strictly, EPERM is better here. However it requires us to
// modify many callsites in RPC, and returning EPERM does not
// make differences except for logging, thus we keep this
// change transparent to RPC right now.
return
EINVAL
/*note*/
;
return
EPERM
;
}
}
meta
->
mutex
.
unlock
();
...
...
src/bthread/id.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/interrupt_pthread.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/interrupt_pthread.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/key.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014
...
...
src/bthread/list_of_abafree_id.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2016 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Mon Jun 20 11:57:23 CST 2016
...
...
src/bthread/log.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Mon Sep 15 10:51:15 CST 2014
...
...
src/bthread/mutex.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014
...
...
src/bthread/mutex.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2015 baidu-rpc authors.
//
// Licensed 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.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/12/14 18:17:04
...
...
src/bthread/parking_lot.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2017 baidu-rpc authors.
//
// Licensed 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.
// Author: chenzhangyi01@baidu.com, gejun@baidu.com
// Date: 2017/07/27 23:07:06
...
...
src/bthread/processor.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Fri Dec 5 13:40:57 CST 2014
...
...
src/bthread/remote_task_queue.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2017 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun, 22 Jan 2017
...
...
src/bthread/stack.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Sep 7 22:37:39 CST 2014
...
...
src/bthread/stack.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Sep 7 22:37:39 CST 2014
...
...
src/bthread/stack_inl.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Sep 7 22:37:39 CST 2014
...
...
src/bthread/sys_futex.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/sys_futex.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/task_control.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/task_control.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/task_group.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/task_group.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/task_group_inl.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/task_meta.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/timer_thread.cpp
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2010 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
...
...
src/bthread/timer_thread.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2010 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
...
...
src/bthread/types.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/unstable.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
src/bthread/work_stealing_queue.h
View file @
d5b90801
// bthread - A M:N threading library to make applications more concurrent.
// Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2012 baidu-rpc authors.
//
// Licensed 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.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012
...
...
test/bthread_butex_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_cond_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_countdown_event_unittest.cpp
View file @
d5b90801
// Copyright (c) 201
6 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 201
4 baidu-rpc authors.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/06/03 13:25:44
...
...
test/bthread_dispatcher_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_execution_queue_unittest.cpp
View file @
d5b90801
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2015 baidu-rpc authors.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/11/09 19:09:02
...
...
test/bthread_fd_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_futex_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
#include <stdlib.h>
...
...
test/bthread_id_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
@@ -397,10 +397,15 @@ TEST(BthreadIdTest, reset_range) {
static
bool
any_thread_quit
=
false
;
static
void
*
fail_to_lock_id
(
void
*
arg
)
{
bthread_id_t
id
=
*
(
bthread_id_t
*
)
arg
;
struct
FailToLockIdArgs
{
bthread_id_t
id
;
int
expected_return
;
};
static
void
*
fail_to_lock_id
(
void
*
args_in
)
{
FailToLockIdArgs
*
args
=
(
FailToLockIdArgs
*
)
args_in
;
base
::
Timer
tm
;
EXPECT_EQ
(
EINVAL
,
bthread_id_lock
(
id
,
NULL
));
EXPECT_EQ
(
args
->
expected_return
,
bthread_id_lock
(
args
->
id
,
NULL
));
any_thread_quit
=
true
;
return
NULL
;
}
...
...
@@ -412,8 +417,9 @@ TEST(BthreadIdTest, about_to_destroy_before_locking) {
ASSERT_EQ
(
0
,
bthread_id_about_to_destroy
(
id
));
pthread_t
pth
;
bthread_t
bth
;
ASSERT_EQ
(
0
,
pthread_create
(
&
pth
,
NULL
,
fail_to_lock_id
,
&
id
));
ASSERT_EQ
(
0
,
bthread_start_background
(
&
bth
,
NULL
,
fail_to_lock_id
,
&
id
));
FailToLockIdArgs
args
=
{
id
,
EPERM
};
ASSERT_EQ
(
0
,
pthread_create
(
&
pth
,
NULL
,
fail_to_lock_id
,
&
args
));
ASSERT_EQ
(
0
,
bthread_start_background
(
&
bth
,
NULL
,
fail_to_lock_id
,
&
args
));
// The threads should quit soon.
pthread_join
(
pth
,
NULL
);
bthread_join
(
bth
,
NULL
);
...
...
@@ -453,8 +459,9 @@ TEST(BthreadIdTest, about_to_destroy_during_locking) {
any_thread_quit
=
false
;
pthread_t
pth
;
bthread_t
bth
;
ASSERT_EQ
(
0
,
pthread_create
(
&
pth
,
NULL
,
fail_to_lock_id
,
&
id
));
ASSERT_EQ
(
0
,
bthread_start_background
(
&
bth
,
NULL
,
fail_to_lock_id
,
&
id
));
FailToLockIdArgs
args
=
{
id
,
EPERM
};
ASSERT_EQ
(
0
,
pthread_create
(
&
pth
,
NULL
,
fail_to_lock_id
,
&
args
));
ASSERT_EQ
(
0
,
bthread_start_background
(
&
bth
,
NULL
,
fail_to_lock_id
,
&
args
));
usleep
(
100000
);
ASSERT_FALSE
(
any_thread_quit
);
...
...
test/bthread_key_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_list_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Sep 30 16:52:32 CST 2014
...
...
test/bthread_mutex_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_ping_pong_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
#include <stdlib.h>
...
...
test/bthread_rwlock_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
#include <stdlib.h>
...
...
test/bthread_setconcurrency_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_timer_thread_unittest.cpp
View file @
d5b90801
// Copyright
Baidu.com (2010), All Rights Reserved
.
// Copyright
(c) 2010 baidu-rpc authors
.
// Author: Yang Liu (yangliu@baidu.com)
#include <gtest/gtest.h>
...
...
test/bthread_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/bthread_work_stealing_queue_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
#include <algorithm> // std::sort
...
...
test/object_pool_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
test/resource_pool_unittest.cpp
View file @
d5b90801
// Copyright (c) 2014
Baidu.com, Inc. All Rights Reserved
// Copyright (c) 2014
baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014
...
...
tools/patch_from_svn
View file @
d5b90801
...
...
@@ -35,6 +35,9 @@ fi
cat
$PATCHFILE
|
sed
-e
's/src\/baidu\/rpc\//src\/brpc\//g'
\
-e
's/\<baidu\/rpc\//brpc\//g'
\
-e
's/\<src\/brpc\/test\/test_\(.*\)\.cpp/test\/brpc_\1_unittest.cpp/g'
\
-e
's/\<test\/test_bthread\.cpp/test\/bthread_unittest.cpp/g'
\
-e
's/\<test\/test_object_pool\.cpp/test\/object_pool_unittest.cpp/g'
\
-e
's/\<test\/test_resource_pool\.cpp/test\/resource_pool_unittest.cpp/g'
\
-e
"s/
\<
test
\/
test_
\(
.*
\)\.
cpp/test
\/
${
TEST_PREFIX
}
\1
${
TEST_SUFFIX
}
.cpp/g"
\
-e
's/\<namespace \+baidu *{/namespace brpc {/g'
\
-e
's/\<namespace \+rpc *{//g'
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment