Commit d5b90801 authored by gejun's avatar gejun

Patch svn r35208

parent 3ee0f366
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 22 17:30:12 CST 2014 // Date: Tue Jul 22 17:30:12 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 22 17:30:12 CST 2014 // Date: Tue Jul 22 17:30:12 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Mon Sep 15 10:51:15 CST 2014 // Date: Mon Sep 15 10:51:15 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014 // Date: Sun Aug 3 12:46:15 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/12/14 21:26:26 // Date: 2015/12/14 21:26:26
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/06/03 13:15:24 // Date: 2016/06/03 13:15:24
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/06/03 13:06:40 // Date: 2016/06/03 13:06:40
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Wed Jul 30 11:47:19 CST 2014 // Date: Wed Jul 30 11:47:19 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Wed Jul 30 11:47:19 CST 2014 // Date: Wed Jul 30 11:47:19 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/04/16 18:43:24 // Date: 2016/04/16 18:43:24
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/10/23 18:16:16 // Date: 2015/10/23 18:16:16
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/10/27 17:39:48 // Date: 2015/10/27 17:39:48
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Thu Aug 7 18:56:27 CST 2014 // Date: Thu Aug 7 18:56:27 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014 // Date: Sun Aug 3 12:46:15 CST 2014
...@@ -432,11 +444,7 @@ int bthread_id_lock_and_reset_range_verbose( ...@@ -432,11 +444,7 @@ int bthread_id_lock_and_reset_range_verbose(
meta->mutex.lock(); meta->mutex.lock();
} else { // bthread_id_about_to_destroy was called. } else { // bthread_id_about_to_destroy was called.
meta->mutex.unlock(); meta->mutex.unlock();
// Strictly, EPERM is better here. However it requires us to return EPERM;
// 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*/;
} }
} }
meta->mutex.unlock(); meta->mutex.unlock();
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014 // Date: Sun Aug 3 12:46:15 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Mon Jun 20 11:57:23 CST 2016 // Date: Mon Jun 20 11:57:23 CST 2016
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Mon Sep 15 10:51:15 CST 2014 // Date: Mon Sep 15 10:51:15 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Aug 3 12:46:15 CST 2014 // Date: Sun Aug 3 12:46:15 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/12/14 18:17:04 // Date: 2015/12/14 18:17:04
......
// bthread - A M:N threading library to make applications more concurrent. // 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 // Author: chenzhangyi01@baidu.com, gejun@baidu.com
// Date: 2017/07/27 23:07:06 // Date: 2017/07/27 23:07:06
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Fri Dec 5 13:40:57 CST 2014 // Date: Fri Dec 5 13:40:57 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun, 22 Jan 2017 // Date: Sun, 22 Jan 2017
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Sep 7 22:37:39 CST 2014 // Date: Sun Sep 7 22:37:39 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Sep 7 22:37:39 CST 2014 // Date: Sun Sep 7 22:37:39 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Sep 7 22:37:39 CST 2014 // Date: Sun Sep 7 22:37:39 CST 2014
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// bthread - A M:N threading library to make applications more concurrent. // 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) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Jul 10 17:40:58 CST 2012 // Date: Tue Jul 10 17:40:58 CST 2012
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2016/06/03 13:25:44 // Date: 2016/06/03 13:25:44
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2015 baidu-rpc authors.
// Author: Zhangyi Chen (chenzhangyi01@baidu.com) // Author: Zhangyi Chen (chenzhangyi01@baidu.com)
// Date: 2015/11/09 19:09:02 // Date: 2015/11/09 19:09:02
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
#include <stdlib.h> #include <stdlib.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
...@@ -397,10 +397,15 @@ TEST(BthreadIdTest, reset_range) { ...@@ -397,10 +397,15 @@ TEST(BthreadIdTest, reset_range) {
static bool any_thread_quit = false; static bool any_thread_quit = false;
static void* fail_to_lock_id(void* arg) { struct FailToLockIdArgs {
bthread_id_t id = *(bthread_id_t*)arg; bthread_id_t id;
int expected_return;
};
static void* fail_to_lock_id(void* args_in) {
FailToLockIdArgs* args = (FailToLockIdArgs*)args_in;
base::Timer tm; 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; any_thread_quit = true;
return NULL; return NULL;
} }
...@@ -412,8 +417,9 @@ TEST(BthreadIdTest, about_to_destroy_before_locking) { ...@@ -412,8 +417,9 @@ TEST(BthreadIdTest, about_to_destroy_before_locking) {
ASSERT_EQ(0, bthread_id_about_to_destroy(id)); ASSERT_EQ(0, bthread_id_about_to_destroy(id));
pthread_t pth; pthread_t pth;
bthread_t bth; bthread_t bth;
ASSERT_EQ(0, pthread_create(&pth, NULL, fail_to_lock_id, &id)); FailToLockIdArgs args = { id, EPERM };
ASSERT_EQ(0, bthread_start_background(&bth, NULL, fail_to_lock_id, &id)); 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. // The threads should quit soon.
pthread_join(pth, NULL); pthread_join(pth, NULL);
bthread_join(bth, NULL); bthread_join(bth, NULL);
...@@ -453,8 +459,9 @@ TEST(BthreadIdTest, about_to_destroy_during_locking) { ...@@ -453,8 +459,9 @@ TEST(BthreadIdTest, about_to_destroy_during_locking) {
any_thread_quit = false; any_thread_quit = false;
pthread_t pth; pthread_t pth;
bthread_t bth; bthread_t bth;
ASSERT_EQ(0, pthread_create(&pth, NULL, fail_to_lock_id, &id)); FailToLockIdArgs args = { id, EPERM };
ASSERT_EQ(0, bthread_start_background(&bth, NULL, fail_to_lock_id, &id)); 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); usleep(100000);
ASSERT_FALSE(any_thread_quit); ASSERT_FALSE(any_thread_quit);
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Tue Sep 30 16:52:32 CST 2014 // Date: Tue Sep 30 16:52:32 CST 2014
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
#include <stdlib.h> #include <stdlib.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
#include <stdlib.h> #include <stdlib.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright Baidu.com (2010), All Rights Reserved. // Copyright (c) 2010 baidu-rpc authors.
// Author: Yang Liu (yangliu@baidu.com) // Author: Yang Liu (yangliu@baidu.com)
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
#include <algorithm> // std::sort #include <algorithm> // std::sort
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved // Copyright (c) 2014 baidu-rpc authors.
// Author: Ge,Jun (gejun@baidu.com) // Author: Ge,Jun (gejun@baidu.com)
// Date: Sun Jul 13 15:04:18 CST 2014 // Date: Sun Jul 13 15:04:18 CST 2014
......
...@@ -35,6 +35,9 @@ fi ...@@ -35,6 +35,9 @@ fi
cat $PATCHFILE | sed -e 's/src\/baidu\/rpc\//src\/brpc\//g' \ cat $PATCHFILE | sed -e 's/src\/baidu\/rpc\//src\/brpc\//g' \
-e 's/\<baidu\/rpc\//brpc\//g' \ -e 's/\<baidu\/rpc\//brpc\//g' \
-e 's/\<src\/brpc\/test\/test_\(.*\)\.cpp/test\/brpc_\1_unittest.cpp/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/\<test\/test_\(.*\)\.cpp/test\/${TEST_PREFIX}\1${TEST_SUFFIX}.cpp/g" \
-e 's/\<namespace \+baidu *{/namespace brpc {/g' \ -e 's/\<namespace \+baidu *{/namespace brpc {/g' \
-e 's/\<namespace \+rpc *{//g' \ -e 's/\<namespace \+rpc *{//g' \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment