| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 namespace WTF { | 55 namespace WTF { |
| 56 | 56 |
| 57 // Functional.h provides a very simple way to bind a function pointer and argume
nts together into a function object | 57 // Functional.h provides a very simple way to bind a function pointer and argume
nts together into a function object |
| 58 // that can be stored, copied and invoked, similar to how boost::bind and std::b
ind in C++11. | 58 // that can be stored, copied and invoked, similar to how boost::bind and std::b
ind in C++11. |
| 59 | 59 |
| 60 // Thread Safety: | 60 // Thread Safety: |
| 61 // | 61 // |
| 62 // WTF::bind() and SameThreadClosure should be used for same-thread closures | 62 // WTF::bind() and SameThreadClosure should be used for same-thread closures |
| 63 // only, i.e. the closures must be created, executed and destructed on | 63 // only, i.e. the closures must be created, executed and destructed on |
| 64 // the same thread. | 64 // the same thread. |
| 65 // Use threadSafeBind() and CrossThreadClosure if the function/task is called | 65 // Use crossThreadBind() and CrossThreadClosure if the function/task is called |
| 66 // or destructed on a (potentially) different thread from the current thread. | 66 // or destructed on a (potentially) different thread from the current thread. |
| 67 | 67 |
| 68 // WTF::bind() and move semantics | 68 // WTF::bind() and move semantics |
| 69 // ============================== | 69 // ============================== |
| 70 // | 70 // |
| 71 // For unbound parameters (arguments supplied later on the bound functor directl
y), there are two ways to pass movable | 71 // For unbound parameters (arguments supplied later on the bound functor directl
y), there are two ways to pass movable |
| 72 // arguments: | 72 // arguments: |
| 73 // | 73 // |
| 74 // 1) Pass by rvalue reference. | 74 // 1) Pass by rvalue reference. |
| 75 // | 75 // |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 using WTF::passed; | 272 using WTF::passed; |
| 273 using WTF::unretained; | 273 using WTF::unretained; |
| 274 using WTF::crossThreadUnretained; | 274 using WTF::crossThreadUnretained; |
| 275 | 275 |
| 276 using WTF::Function; | 276 using WTF::Function; |
| 277 using WTF::SameThreadClosure; | 277 using WTF::SameThreadClosure; |
| 278 using WTF::CrossThreadClosure; | 278 using WTF::CrossThreadClosure; |
| 279 | 279 |
| 280 #endif // WTF_Functional_h | 280 #endif // WTF_Functional_h |
| OLD | NEW |