Citing an unpublished paper? plagiarism? Here is the situation: I am working with 2 others on a paper A, and simultaneously by myself separately on a paper B (which is a thesis). 


A and B are on very much similar topics. 
I started with paper B slightly before we started working on paper A, but the ideas in paper B build upon the ideas in paper A.
Moreover, paper A will very likely be published sooner than paper B. My plan at first was to cite paper A in paper B. 
However, my other 2 co-authors have now started to shift their idea about what domain of paper A should be, and they are shifting towards the topic of my paper B, and have even started to reinvent some of my ideas in paper B. 
Therefore, I am very concerned that this will cause a plagiarism issue: If we decide that paper A should contain many of the ideas in paper B, then ideally, I would want A to cite B: I came up with these ideas independently and for a different paper, so if A wants to use them, paper B (i.e. myself) should get credit for the work (since I put in all the work and came up with it first, and we originally didn't plan to put it in paper A). But paper A will likely get published before paper B is handed in as a thesis.


Most importantly: I need to hand in paper B as a thesis, and I cannot afford not to hand it in, or to make a completely different thesis. Therefore I need to be sure that paper B does not commit (self?) plagiarism. 


Is there a way for paper A to cite paper B (my thesis), even though paper A will be published before B?
If no, how to avoid (self?) plagiarism in this situation? (somehow integrate parts of B in A while still recognising B as the original work that is a separate thesis and gets credit as such?)
Is it generally stupid to work on two papers simultaneously like this? Did I make a big mistake...?
There is no particular problem with citing unpublished work. Just list it as such. There is no problem with citing work that will not ever be published in fact. Just name the author and list it as "private communication". Give a title if appropriate, or a description. 

In the case at hand, it seems wiser to cite A within B as it is likely to be published first, but since you don't have the final version, it could be listed as "unpublished, in preparation". 

Talk to your advisor, of course, about what he/she recommends here. I think in most cases the rules on a thesis can be, with permission of the advisor, a bit looser than for formally published work. You need to cite, in any case, but the fact that things are a bit tentative can be finessed. 

As for plagiarism, cite your own work, whether joint or not, just as you would the work of another.